Error number 1130 Host 'ip' is not allowed to connect to this MySQL server

I caught up with 618 today. I used the Alibaba Cloud server for the first time. I installed MySQL8 on the Alibaba Cloud server. I want to remotely connect to the MySQL on the Alibaba Cloud server through the local SQLyog.

insert image description here

When port 3306 is opened on the server, the following problems are encountered
insert image description here


Solution:
open server terminal
insert image description here

Since mysql does not allow other computers (non-virtual hosts) to access with IP addresses by default, the
host of the user to be accessed (I am root here) is changed from localhost (this machine) to % (any ip, you can also specify ip) and
finally flush Privileges refresh permissions to
insert image description here
test the connection
insert image description here
OK

Guess you like

Origin blog.csdn.net/Aurinko324/article/details/125346382