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)
1. Make sure the system has the required libaio s...
Preface BINARY and VARBINARY are somewhat similar...
Table of contents 1. Phenomenon 2. Solution 3. Su...
When setting display:flex, justify-content: space...
When we develop a web project with Django, the te...
Table of contents First, let's talk about the...
Table of contents Use two-way binding data in v-m...
Border Style The border-style property specifies ...
1. 85% of ads go unread <br />Interpretatio...
Table of contents The first step of optimization:...
Table of contents Preface: 1. Understand lock wai...
This article example shares the specific code of ...
Table of contents 1. Node.js and Vue 2. Run the f...
Table of contents 1. Timestamp to date 2. Convert...
The uniapp applet will have a similar drop-down p...