mysql 为外部访问创建账号

各种报错,如 Host '192.168.23.132' is not allowed to connect to this MySQL server

Operation ALTER USER failed for 'root'@'

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED BY 'root' WITH GRANT OPTION' at

一键处理:

DROP USER 'fly'@'%';
CREATE USER 'fly'@'%' IDENTIFIED BY 'root';
GRANT ALL PRIVILEGES ON *.* TO 'fly'@'%';  
FLUSH PRIVILEGES;

再测试连接 :mysql -h MYSQL_SERVER_IP -u fly -p

你可能感兴趣的:(mysql,数据库)