mysql is not allowed to connect to this MySQL server解决方案

  • Post author:
  • Post category:mysql




mysql is not allowed to connect to this MySQL server解决方案

在检查mysql服务开启后,3306端口也已经开放后连接数据库报”is not allowed to connect to this MySQL server”错误

这种情况是因为MySQL安装完毕后不允许远程登录

解决方法如下:

1.执行 mysql -u root -p,然后输入密码登陆mysql

2.授权法。

使用myuser使用mypassword从任何主机连接到mysql服务器。

执行:GRANT ALL PRIVILEGES ON

.

TO ‘myuser’@’%’ IDENTIFIED BY ‘mypassword’ WITH GRANT OPTION;

3.执行:FLUSH PRIVILEGES;

4.此时可以使用myuser用户,mypassword密码远程登陆mysql服务器了



版权声明:本文为superJamison原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。