Navicat connection database appears is not allowed to connect to this MySQL server error

1. Mysql locally connected to the Linux server reports an error, as follows:

 2. The cause of the problem

We found that the firewall has been closed, and this situation still occurs, because the mysql data only allows the connection of the machine where it is located, and does not allow remote connections

3. Solution

(1) Enter mysql on the machine where the mysql service is installed:

 (2) Then use the use mysql command, the following error occurs.

 (3) If an error is reported in the above figure, it is because the initial password of mysql has not been modified. Use the following command to modify the initial password. The mosaic is my modified password.

alter user 'root'@'localhost' identified by 'Test%90Test';

 (4) After the modification is successful, use the following command

use mysql;
select host from user where user='root';

 The value of host in the data result obtained by executing the query statement is localhost

(5) Use the update statement to modify permissions

update user set host = '%' where user = 'root';

 (6) Refresh the configuration, host becomes %

flush privileges;

 

 (7) The connection is successful and the problem is solved

 

Guess you like

Origin blog.csdn.net/weixin_42218169/article/details/130006614