在装有MySQL的机器上登录MySQL mysql -u root -p密码 执行use mysql; 执行update user set host = '%' where user = 'root' and host = "localhost" ; 执行FLUSH PRIVILEGES;