使用Navicat连接Linux 下的MySQL遇到的问题

Error1: 2003:Can't connect to MySQL server on 'localhost'
解决方法:关闭Linux的防火墙功能,或者设置容许TCP协议的3306端口通过,可以下使用如下命令开启TCP协议的3306端口
iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
Error2: 1130 - Host'ClientIP' is not allowed to connect to this MySQL server
解决方法:使用root 用户登陆Linux,登陆MySQL的root用户,更改容许登陆的IP地址范围。
mysql>grant all privileges on *.* to 'root'@'%' identified by 'rootpasswd' with grant option;
这段指令容许所有用root用户输入密码登陆该mysql server,如果将'%' 换乘'192.168.1.100' ,那么只有'192.168.1.100'的主机可以登陆。

相关文章:

  • 2021-09-14
  • 2022-01-05
  • 2022-01-20
  • 2021-10-20
  • 2021-08-25
  • 2021-12-05
  • 2021-06-04
猜你喜欢
  • 2021-07-23
  • 2021-08-08
  • 2021-08-30
  • 2021-07-26
  • 2021-05-26
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案