mysql使用localhost可以连接,使用ip连接不上
原因分析 :高版本的MySQL把将创建账户和赋予权限分开了。
解决方法:分开执行。
#创建账户
create user 'root'@'%' identified by '123456';
#赋予权限
grant all privileges on *.* to 'root'@'%' with grant option;
#刷新
flush privileges;
mysql使用localhost可以连接,使用ip连接不上
原因分析 :高版本的MySQL把将创建账户和赋予权限分开了。
解决方法:分开执行。
#创建账户
create user 'root'@'%' identified by '123456';
#赋予权限
grant all privileges on *.* to 'root'@'%' with grant option;
#刷新
flush privileges;