mysql -u root -p
use mysql;
update user set host = '%' where user = 'root' and host='localhost';
select host, user from user;
GRANT ALL PRIVILEGES ON . TO 'myuser'@'192.168.1.3' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
FLUSH PRIVILEGES;
原文链接:https://blog.csdn.net/weixin_31061699/article/details/113690680