远程连接ubuntu的mysql数据库不能连上

2017-07-21  本文已影响0人  Mr_Laoyu

mysql是apt-get安装的
1.给账户连接的权限

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
flush privileges;

2.在mysqld.cnf找到bind-address = 127.0.0.1,加个#号注释掉
配置文件路径 /etc/mysql/mysql.conf.d/mysqld.cnf

#bind-address = 127.0.0.1

3.重启服务器

sudo service mysql restart
上一篇 下一篇

猜你喜欢

热点阅读