mysql 登录提示 “is not allowed to connect to this mysql server”-dcrenl


解决方法一

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

  1. GRANT ALL PRIVILEGES ON . TO ‘myuser’@’%’ IDENTIFIED BY ‘mypassword’ WITH GRANT OPTION;

  1. 执行:FLUSH PRIVILEGES;

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

解决方法二

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

  1. use mysql;

  1. select host from user where user= 'root';查看当前mysql允许登录的地址

  1. update user set host='%' where user = 'root';

  1. flush privileges;

以上两种方式都可以使用