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:
|
<<: 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)
Base image The base image has two meanings: Does ...
Effective solution for Ubuntu in virtual machine ...
DTD is a set of grammatical rules for markup. It i...
Adding/removing classes to elements is a very com...
During the use of mysql, it was found that the nu...
HTML forms are commonly used to collect user info...
Example Usage Copy code The code is as follows: &l...
Taking Windows as an example, Linux is actually t...
Anyone who has studied or used HTML should be fam...
First, download a series of things from the Alipa...
1. Global Object All modules can be called 1) glo...
TRUNCATE TABLE Deletes all rows in a table withou...
Mouse effects require the use of setTimeout to ge...
Table of contents Optimization of if judgment 1. ...
This article records the specific method of insta...