mysql -u root -p

修改mysql库的user表,将host项,从localhost改为%。%这里表示的是允许任意host访问,如果只允许某一个ip访问,则可改为相应的ip

mysql> use mysql;
mysql> update user set host = '%' where user = 'root';
mysql> select host, user from user;
mysql> flush privileges;

重启mysql服务

/etc/init.d/mysqld restart

防火墙开放3306端口

iptables -A INPUT -p tcp --dport 3306 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 3306 -j ACCEPT

 

相关文章:

  • 2021-12-28
  • 2021-12-19
  • 2022-01-07
  • 2022-01-07
  • 2022-01-07
  • 2022-01-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-21
  • 2021-12-31
  • 2022-12-23
相关资源
相似解决方案