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

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

结束!

  • 2
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值