这里我远程连接修改的几个地方写一下:

1. 设置root 外部访问权限,

mysql> GRANT ALL PRIVILEGES ON *.* TO [email protected]"%" IDENTIFIED BY "root";
mysql> flush privileges;


这是新建用户设置访问权限 

mysql>grant all on databasename.* to 'username'@'%' identified by 'password' with grant option;


2.设置防火墙

我这里是直接关闭防火墙

systemctl stop firewalld 

service iptables stop


3.设置安全组

添加3306端口


4.配置my.cnf文件          --> 之前我上面的都配置好了,就是不行。网上也没有搜到说要配置这个文件的。不知道是我的系统原因还是什么原因,最后在群里问人才知道的。把问题解决了。

在[mysqld] 下面添加 bind-address=0.0.0.0

阿里云centos7安装mysql 5.7 无法远程连接

相关文章:

  • 2022-12-23
  • 2021-11-08
  • 2021-12-04
  • 2022-01-14
  • 2021-08-30
  • 2022-01-15
  • 2021-10-17
  • 2021-06-02
猜你喜欢
  • 2021-04-12
  • 2021-07-22
  • 2021-05-10
  • 2021-08-09
  • 2022-01-18
  • 2022-12-23
  • 2021-05-24
相关资源
相似解决方案