当前位置:网站首页>is not allowed to connect to this mysql server

is not allowed to connect to this mysql server

2022-06-21 10:47:00 Code knower

Tencent cloud docker Installed mysql, The firewall port is open , Found using a local computer navicat The link doesn't go up . The reason is known through understanding , I wrote an article here , After saving, I met .

Error as shown in the figure .

Enter the self initiated container

sudo docker exec -it mysql /bin/bash

 mysql -u root -p    Log in to mysql in .

use mysql; 

 

 select host from user where user='root';

 

The modified account is not allowed to log in remotely , Only in localhost. At this time, as long as localhost The computer of , Log in MySQL after , change "mysql" In the database "user" Exterior and interior "host" term , from "localhost" rename "%" 

 

Refresh configuration . 

flush privileges; 

 

  Finally, as shown in the picture . Successful connection .

 

原网站

版权声明
本文为[Code knower]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202221439118960.html