mysql开启远程访问

进入
mysql -uroot -h127.0.0.1-p
use mysql


新增一个用户

create user user02@'%' identified by 'password'

设置某个用户权限:update user set host='%' where user='yuancheng' and host='127.0.0.1';

flush privileges;

关闭授权
mysql -uroot -h127.0.0.1 -p
update user set host='127.0.0.1' where user='yuancheng' and host='%';


FLUSH PRIVILEGES;

exit; 退出

move on
原文地址:https://www.cnblogs.com/amy720/p/12186141.html