1.
mysql>use mysql;
mysql>update user set host = '%' where user = 'root';
mysql>select host, user from user;
2.
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
mysql>flush privileges;
說明:%是哪個IP地址可以訪問這個MYsql服務,可以換成你想要的IP地址!