网络编程
位置:首页>> 网络编程>> 数据库>> Mysql连接本地报错:1130-host ... is not allowed to connect to this MySQL server解决

Mysql连接本地报错:1130-host ... is not allowed to connect to this MySQL server解决

作者:永不消逝的黑眼圈  发布时间:2024-01-28 04:52:50 

标签:连接本地,报错,1130

右击开始图标,打开“命令提示符(管理员)”。

1、输入代码,停止服务。 

net stop MySQL57         // 我的MySQL是57版本的

2、转到mysql的bin目录下。

3、输入代码,启动mysql 跳过权限。

mysqld --skip-grant-tables
//执行到这里就只会有光标在一闪一闪无法继续写命令或输入任何命令,故重新再打开一个cmd窗口

Mysql连接本地报错:1130-host ... is not allowed to connect to this MySQL server解决

4、再打开一个CMD,再次转到mysql的根目录下

Mysql连接本地报错:1130-host ... is not allowed to connect to this MySQL server解决

 5、输入代码,进入mysql。

mysql

 6、输入代码,刷新数据库。

flush privileges;

Mysql连接本地报错:1130-host ... is not allowed to connect to this MySQL server解决

 7、输入代码,使用mysql数据库。

 use mysql  
//可以看到user表

Mysql连接本地报错:1130-host ... is not allowed to connect to this MySQL server解决

 8、输入代码,查看本地用户。

select Host,User,authentication_string from user;

Mysql连接本地报错:1130-host ... is not allowed to connect to this MySQL server解决

9、输入代码把root用户的Host修改为%。

update user set host = '%' where user ='root';

Mysql连接本地报错:1130-host ... is not allowed to connect to this MySQL server解决

 10、返回mysql连接页面,登录成功。

Mysql连接本地报错:1130-host ... is not allowed to connect to this MySQL server解决

来源:https://blog.csdn.net/m0_46527351/article/details/127426455

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com