1. Install MySQL server, client and client development tools
sudo apt install mysql-server mysql-client libmysqlclient-dev
2. Setting up remote access MySQL
sudo vi/etc/mysql/mysql.conf.d/mysqld.cnf
Comment out bind-address = 127.0.0.1 this line, save exit Edit
Mysql-u root-p
Enter the MySQL service and enter the following command to allow any machine to access the MySQL server:
Law One: Modify the Permission method:
' Root '@'%'mypassword' with grant option; MySQL > Flush Privileges;
Law II: Modify the Table method:
Select host,user from user;
The results are as follows:
Mysql> select Host,user from user;
+-----------+------------------+
| Host | user |
+-----------+------------------+
| localhost | Debian-sys-maint |
| localhost | mysql.session |
| localhost | Mysql.sys |
| localhost | Root |
+-----------+------------------+
4 rows in Set (0.01 sec)
Change the host of user root to%:
mysql> Update user set host= '% ' where user= ' root ';
The results of the query are as follows:
Select host,user from user; +-----------+------------------+| Host | user |+-----------+------------------+|% | root | | localhost | debian-sys-maint | | localhost | Mysql.session | | localhost | mysql.sys |+-----------+------------------+4 in Set ( 0.00 sec)
Make the changes effective:
mysql> flush Privileges;
3. Connect the MySQL service using the MySQL client GUI tool (NAVICAT)
Ubuntu install MySQL