一、连接数据库
mysql -u root -p // 在下一行输入密码
二、为root用户开启远程连接mysql数据库(注意要带分号)
grant all privileges on *.* to 'root'@'%' identified by 'root' with grant option;
三、刷新权限(注意要带分号)
flush privileges;
mysql -u root -p // 在下一行输入密码
grant all privileges on *.* to 'root'@'%' identified by 'root' with grant option;
flush privileges;