mysql -u root -p 密码
use mysql;
select host, user from user;
update user set host = '%' where user ='root' and host = 'localhost';
select host, user from user;
flush privileges;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'admin123' WITH GRANT OPTION;
flush privileges;
现在就可以使用root用户,密码admin123从外网访问了
No comments:
Post a Comment