Mysql报错:1130-host ... is not allowed to connect to this MySql server如何处理

Mysql报错:1130-host ... is not allowed to connect to this MySql server如何处理_第1张图片
Mysql报错:1130-host ... is not allowed to connect to this MySql server如何处理_第2张图片

具体步骤

1、连接服务器: mysql -u root -p

Mysql报错:1130-host ... is not allowed to connect to this MySql server如何处理_第3张图片

2、查看当前所有数据库:show databases;

Mysql报错:1130-host ... is not allowed to connect to this MySql server如何处理_第4张图片

3、进入mysql数据库:use mysql;

Mysql报错:1130-host ... is not allowed to connect to this MySql server如何处理_第5张图片

4、查看mysql数据库中所有的表:show tables;

Mysql报错:1130-host ... is not allowed to connect to this MySql server如何处理_第6张图片

5、查看user表中的数据:select Host, User,Password from user;

在这里插入图片描述

6、修改user表中的Host:update user set Host=‘%’ where User=‘root’;

在这里插入图片描述

PS:如果出现报错,忽略即可:ERROR 1130: Host ‘192.168.10.173’ is not allowed to connect to this MySQL ERROR 1062 (23000): Duplicate entry ‘%-root’ for key ‘PRIMARY’ 忽略即可

7、最后刷新一下即可:flush privileges;

在这里插入图片描述

你可能感兴趣的:(Linux,数据结构,mysql,数据库,linux)