mysql版本 mysql7
use mysql;
update user set host = '%' where user = 'root';
select host, user from user;
刷新数据库 flush privileges;
退出: quit;
重启mysql service mysqld restart
mysql版本 mysql7
use mysql;
update user set host = '%' where user = 'root';
select host, user from user;
刷新数据库 flush privileges;
退出: quit;
重启mysql service mysqld restart