use mysql; // 修改一条 root 数据,并刷新MySQL的系统权限相关表 update user set Host = '%' where Host = 'localhost' and User = 'root'; flush privileges; // grant 命令重新创建一个用户 grant all privileges on *.* to root@"%" identified by "root"; flush privileges;