Host 'XXX' is not allowed to connect to this MySQL server Solution/Open Root MySQL remote account

1. Log in to mysql:

 

mysql -uroot -p123456

    Or log in through the graphical client;

 

2. Authorize the root account:

 

grant all PRIVILEGES on test_db.* to root@'192.168.21.101'  identified by '123456';

 If it is accessible to all ips, replace the specific ip with %;

grant all PRIVILEGES on test_db.* to root@'%'  identified by '123456';

 123456 is the root password.

 

3. The last step, the most important step, must execute the following statement, otherwise it will not take effect immediately :

flush privileges;

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326438754&siteId=291194637