Host is not allowed to connect to this MySQL server---------------->windows10

时间:2021-09-22 13:16:37

错误,数据库无法远程连接.

第一步,关闭本地防火墙

Host is not allowed to connect to this MySQL server---------------->windows10

注意:

两台连接的机器都需要关闭

第二步,两台机器互相ping,看是否可以互相访问

Host is not allowed to connect to this MySQL server---------------->windows10

丢失为零,意为可以连接.

第三步登录数据库

Host is not allowed to connect to this MySQL server---------------->windows10

Host is not allowed to connect to this MySQL server---------------->windows10

第四步,切换,数据库为mysql,授权访问,因为是本地连接,所以,给予了所有权限

Host is not allowed to connect to this MySQL server---------------->windows10

第五步:修改生效

flush privileges;

Host is not allowed to connect to this MySQL server---------------->windows10

番外:其他方式非全部权限赋予

允许某个特定用户访问本机,比如:192.168.31.255

 grant all privileges on dk.* to 'myuser'@'192.168.31.255' identified by 'mypassword' with grant option;
flush privileges;