1、打开 mysql 数据库
use mysql;
2、查看 user 数据表当前已有的数据
select * from user \G;
3、修改一条 root 数据,并刷新MySQL的系统权限相关表
update user set Host = '%' where Host = 'localhost' and User='root';
flush privileges;
来源地址:https://blog.csdn.net/xiaofengdada/article/details/128556117