遇到报错:
1130 -Host '192.168.1.2' is not allowed to connect to this MySQL server
异常原因:是因为192.168.1.2服务器不允许连接特定的服务器ip
原因1、mysql数据库密码不对
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
解决方案:
1、重置root 密码
sudo systemctl stop mysql
2、以安全模式启动Mysql
sudo mysqld_safe --skip-grant-tables &
3、登录Mysql(无需密码)
mysql -u root
4、重置密码
USE mysql;
UPDATE user SET authentication_string=PASSWORD('root') WHERE User='root';
FLUSH PRIVILEGES;
EXIT;