mysql--赋予用户远程连接数据库的权限

解决Host is not allowed to connect to this MySQL server报错信息


GRANT ALL PRIVILEGES ON *.* TO '用户名'@'数据库所在主机IP' IDENTIFIED BY '连接密码' WITH GRANT OPTION;

例如:

第一步:赋予权限
GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.1.127' IDENTIFIED BY 'tiger' WITH GRANT OPTION;

第二部:刷新权限
flush privileges; 

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