bymingliang

 

一、检查阿里云安全组规则设置

 参考:https://www.cnblogs.com/bymingliang/p/12131625.html

二、检查iptables防火墙设置

 参考:https://www.cnblogs.com/bymingliang/p/12131651.html

三、在iptables中3306开放端口

1. 先找到iptables

whereis iptables

 

 

2. 允许3306端口通过防火墙

vi  /etc/iptables.rules

-A INPUT -m state –state NEW -m tcp -p tcp –dport 3306 -j ACCEPT

 

 

3. 重启服务器

sudo reboot

 

四、创建并授权一个允许远程连接的数据库账号

grant all privileges on demo.* to mysql_account@’%’ identified by ‘123456’;

flush privileges; #添加一个用户名为 mysql_account,密码为 123456,授权为% (%表示所有 ip 能连接,可以设置指定 ip)对 demo 数据库所有权限。

分类:

技术点:

相关文章:

  • 2021-08-04
  • 2021-11-02
  • 2021-12-14
  • 2021-08-25
  • 2021-12-10
  • 2021-11-14
  • 2021-07-17
猜你喜欢
  • 2021-09-04
  • 2022-01-20
  • 2021-12-14
  • 2021-09-19
  • 2021-11-06
  • 2021-10-01
  • 2021-06-18
相关资源
相似解决方案