mysql -u root -p
use mysql;
select host, user, authentication_string, plugin from user
grant all privileges on *.* to ‘root‘@‘%‘ identified by ‘password‘;//设置所有人可访问
flush privileges;//刷新
mysql设置远程可访问
原文:https://www.cnblogs.com/gwxppg/p/11836987.html