Detailed explanation of the process of installing MySQL on Ubuntu 18.04.4

Detailed explanation of the process of installing MySQL on Ubuntu 18.04.4

Let's take a look at the process of installing MySQL on Ubuntu 18.04.4. The content is as follows:

1 sudo apt-get update
2 sudo apt-get install mysql-server
3 sudo mysql_secure_installation # Initial configuration #1
VALIDATE PASSWORD PLUGIN can be used to test passwords...
Press y|Y for Yes, any other key for No: N (My Options)
#2
Please set the password for root here...
New password: (Enter password)
Re-enter new password: (re-enter)
#3
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them...
Remove anonymous users? (Press y|Y for Yes, any other key for No) : N (My option)
#4
Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network...
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : Y (my choice)
#5
By default, MySQL comes with a database named 'test' that
Anyone can access...
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : N (My option)
#6
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y (my choice)
4 systemctl status mysql.service # Check server status
4 systemctl status mysql.service # Check server status

Running means no problem

5 Modify the mysql port number and change the listening address to all vim /etc/mysql/mysql.conf.d/mysqld.cnf # Edit the configuration file bind-address = 0.0.0.0 # Change the listening ip to all port = 3388 # Change the listening port to 3388, you can leave it unchanged for safety. After the modification, restart the service systemctl restart mysql.service
6 Open mysql remote access 1 Log in to the database mysql -u root -p

2 Switch to database mysql
use mysql
3 Delete anonymous users delete from user where user='';
4 Add users who are allowed remote access or allow remote access for existing users. Grant root all permissions to access any database on any host (%). mysql> grant all privileges on *.* to 'root'@'%' identified by 'Replace here with the password you want to set' with grant option;
flush privileges;
5 Exit the database mysql> exit
6 Restart the database sudo service mysql restart

This is the end of this article about the detailed process of installing MySQL on Ubuntu 18.04.4. For more information about installing MySQL on Ubuntu 18.04.4, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How to install JDK and Mysql on Ubuntu 18.04 Linux system
  • Complete tutorial on installing Apache, MySQL, PHP, LAMP on Ubuntu 18.04
  • Ubuntu 18.04 does not prompt for password when installing MySQL and how to solve it

<<:  HTML n ways to achieve alternate color code sample code

>>:  A few things about favicon.ico (it’s best to put it in the root directory)

Recommend

How to install binary MySQL on Linux and crack MySQL password

1. Make sure the system has the required libaio s...

Detailed explanation of binary and varbinary data types in MySQL

Preface BINARY and VARBINARY are somewhat similar...

Detailed steps to start the Django project with nginx+uwsgi

When we develop a web project with Django, the te...

How to implement two-way binding function in vue.js with pure JS

Table of contents First, let's talk about the...

The use of v-model in vue3 components and in-depth explanation

Table of contents Use two-way binding data in v-m...

This article teaches you how to play with CSS border

Border Style The border-style property specifies ...

Interpretation of 17 advertising effectiveness measures

1. 85% of ads go unread <br />Interpretatio...

Docker image optimization (from 1.16GB to 22.4MB)

Table of contents The first step of optimization:...

Analysis of MySQL lock wait and deadlock problems

Table of contents Preface: 1. Understand lock wai...

JS realizes picture digital clock

This article example shares the specific code of ...

How to start a Vue.js project

Table of contents 1. Node.js and Vue 2. Run the f...

WeChat applet wxs date and time processing implementation example

Table of contents 1. Timestamp to date 2. Convert...

About uniApp editor WeChat sliding problem

The uniapp applet will have a similar drop-down p...