远程连接mysql数据库设置

来源:互联网 时间:2017-07-28

本地登入MySQL,更改 “mysql” 数据库里的 “user” 表里的 “host” 项,将”localhost”改为”%”

#mysql -u root -p root

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

若还不能远程,请查看修改my.cnf
vi /etc/MySQL/my.cnf
修改:bind-address = 127.0.0.1->bind-address = 0.0.0.0

相关阅读:
Top