mysql>GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3'IDENTIFIED BY 'mypassword' WITH GRANT OPTION;mysql>FLUSH PRIVILEGES
检查防火墙 如果还不能连接,就可能是防火墙的锅了。
#通过systemctl status firewalld查看firewalld状态#FirewallD is not runningsystemctl unmask firewalld systemctl start firewalld#再次通过systemctl status firewalld查看firewalld状态,显示running即已开启了。#再次执行执行firewall-cmd --permanent --zone=public --add-port=3306/tcp,提示success,表示设置成功,这样就可以继续后面的设置了。firewall-cmd --reloadsystemctl stop firewalld.service #关闭防火墙
Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
解决办法(修改加密规则为普通模式,默认是严格加密模式):
依次输入以下语句
mysql>ALTER USER 'root'@'%' IDENTIFIED BY 'xxxxxxxx' PASSWORD EXPIRE NEVERmysql>ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'xxxxxxxx';mysql>FLUSH PRIVILEGES;