ubuntu mysql 远程连接

1.修改/etc/mysql/my.cnf文件中的bind-address选项设置为MySQL服务器的IP。

2.修改数据库

将MySQL数据库中的user表中的host列的localhost为%

update user set host ='%' where host='localhost' and user='root';  --更新host
3.重启mysql服务。

sudo /etc/init.d/mysql restart  --重启服务

猜你喜欢

转载自blog.csdn.net/weixin_42627035/article/details/85711508