WHYBIGDATA
WHYBIGDATA的博客
posts - 85,comments - 1,views - 10925

Navicat远程连接Linux的MySQL服务Error10061的解决方案


在这里插入图片描述


写在前面

  • Linux:Ubuntu Kylin16.04
  • MySQL: 5.7.33

解决方法

  • 原因:关于Error10061 的最可能原因应该是MySQL中root用户不允许其他ip连接MySQL

  • 修改mysql库下的user表中的root用户允许任意ip连接

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select user, host from user where user = 'root';
+------+-----------+
| user | host |
+------+-----------+
| root | localhost |
+------+-----------+
mysql> update mysql.user set host='%' where user='root';
mysql> select user, host from user where user = 'root';
+------+------+
| user | host |
+------+------+
| root | % |
+------+------+
1 row in set (0.00 sec)
  • 刷新权限
mysql> flush privileges;
  • 修改MySQL配置文件
[zhangsan @node01 /]$ sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf

bind-address= 127.0.0.1这一行删除或者注释掉

  • 再次连接不成功,重启MySQL服务
mysql> quit
[zhangsan @node01 /]$ sudo systemctl restart mysqld

结束!

posted on   WHYBIGDATA  阅读(79)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示