welcome to my blog
MySQL Workbench connection using the cloud server mysql server error: Failed to Connectto MySQL at xxx: xx with user root
The reason: In the default setting, MySQL only allowed to log in as root localhost
在云服务器上以root身份登录
mysql -u root -p
切换至mysql数据库, 这个数据库是自带的
use mysql;
可以通过命令查看这个数据库中有哪些表
show tables;
从user表中查看Host, User这两列的信息
select Host,User from user;
The last line indicates that only allow localhost log in as root
Solution:
The first step, the localhost instead of%, which allows all ip logged in as root (this is actually not appropriate, insecurity), executionupdate user set host = '%' where user ='root';
The second step, refresh the configuration to take effect, executeflush privileges;
Now we can successfully connect to a MySQL server cloud