MySQL>update user set host = '%' where user = 'root'; 

MySQL>select host, user from user; 

MySQL>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;

MySQL>FLUSH PRIVILEGES;

分号不能少

mysql版本5.7