Set mysql to allow Internet access to bitsCN.com
Set mysql to allow Internet access
The root account of mysql. I usually use localhost or 127.0.0.1 during connection,
Mysql on the company's test server is also localhost, so
The solution is as follows:
1. modify the table, log on to the mysql database, switch to the mysql database, and query the table using SQL statements.
See "select host, user from user ;"
Mysql-u root-pvmwaremysql> use mysql;
Mysql> update user set host = '%' where user = 'root ';
Mysql> select host, user from user;
Mysql> flush privileges;
Note: The last sentence is very important to make the modification take effect. if there is no write, remote connection is still not allowed.
2. authorize the user. you want the root user to use the password to connect to the mysql server from any host.
Grant all privileges on *. * TO 'root' @ '%' identified by 'admin123' with grant option;
Flush privileges;
If you want to allow the user root to connect to the mysql server from a host with the ip address 192.168.1.104
Grant all privileges on *. * TO 'myuser' @ '192. 168.1.104 'identified BY 'admin123' with grant option;
Flush privileges;
BitsCN.com