php连接阿里云mysql

1.开启Mysql远程访问端口

现在服务器控制台,安全组那边开启3306端口

2.修改Mysql配置文件

vim /etc/mysql/mysql.conf.d/mysqld.cnf,找到bind-address = 127.0.0.1,注释掉

3.服务器登录mysql

运行grant all on *.* to root@'%' identified by 'root'

参考资料:

https://www.cnblogs.com/patrickding/p/6435459.html

http://blog.sina.com.cn/s/blog_1549bfbd30102x954.html

 

猜你喜欢

转载自www.cnblogs.com/zhp-king/p/8973962.html