服务器之家:专注于VPS、云服务器配置技术及软件下载分享
分类导航

Mysql|Sql Server|Oracle|Redis|MongoDB|PostgreSQL|Sqlite|DB2|mariadb|Access|数据库技术|

服务器之家 - 数据库 - Mysql - Mysql连接本地报错:1130-host ... is not allowed to connect to this MySQL server解决

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

2023-03-17 15:02永不消逝的黑眼圈 Mysql

这篇文章主要给大家介绍了关于Mysql连接本地报错:1130-host ... is not allowed to connect to this MySQL server的解决方法,文中通过图文介绍的非常详细,需要的朋友可以参考下

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

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解决

总结

到此这篇关于Mysql连接本地报错:1130-host ... is not allowed to connect to this MySQL server解决的文章就介绍到这了,更多相关Mysql连接本地报错1130-host内容请搜索服务器之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持服务器之家!

原文链接:https://blog.csdn.net/m0_46527351/article/details/127426455

延伸 · 阅读

精彩推荐