关于 SQLyog 远程连接 Linux 系统的 MySQL 失败的解决方法

阿里云服务器环境(PHP+Nginx+MySQL)

【吐槽】我勒个去,照着网上的方法一样一样的敲,结果把我带进坑了,郁闷了整个上午,现把我的解决方法呈现如下:

关于“Access denied for user 'root'@ '*.*.*.*' (using password: YES)”的解决方法

MySQL 安装完成后,默认是不允许 root 进行远程登录的,我们需要修改 root 的远程启用方式:

1. 打开终端(Xshell / SecureCRT / 其他)

2. 以 root 权限登录

mysql -u root -p

3. 选择 mysql

mysql> use mysql;

4. 指定 root,修改 root 帐号&密码,修改 host 值:

mysql> update user set password=password('你的密码') where user='root' and host='%';

5. 刷新 MySQL 的系统权限相关表

mysql> flush privileges;

6. 退出 mysql 

quit;

7. 重启 MySQL 服务即可完成

service mysqld restart

done!

posted @ 2016-07-09 15:06  JorsonWong  阅读(1265)  评论(0编辑  收藏  举报