Can't connect to mysql: message from server: "Host 'xxxx' is not allowed to connect to this MySQL serve

foreword

Linking to someone else's database today, I found an error:

message from server: “Host ‘’ is not allowed to connect to this MySQL server”

The strange thing is that we are in a local area network, and the ip segments are all the same.

The pin ip is also fine, but the port 3306 is blocked

I checked some information on the Internet and finally found that it was because of database permissions.

Let me share my solution

Solve the problem

1 First find the connected database and open the mysql database

insert image description here

2 Find the user table modification permission

Change the host attribute where user is root, change localhost to % and save

insert image description here

3 Execute the refresh permission command

flush privileges;

insert image description here

4 tests

Retested again and found that the problem was solved.

Guess you like

Origin blog.csdn.net/weixin_46713508/article/details/131571354