`

远程连接不上mysql 报错:1130-host ... is not allowed to connect to this MySql server

阅读更多
[code="java"
授权法:

例如,你想user使用password从任何主机连接到mysql服务器的话。

GRANT ALL PRIVILEGES ON *.* TO 'user'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;

FLUSH   PRIVILEGES;

如果你想允许用户user从ip为192.168.1.8的主机连接到mysql服务器,并使用password作为密码

GRANT ALL PRIVILEGES ON *.* TO 'user'@'192.168.1.8' IDENTIFIED BY 'password' WITH GRANT OPTION;

FLUSH   PRIVILEGES;

如果你想允许用户myuser从ip为192.168.1.8的主机连接到mysql服务器的dk数据库,并使用mypassword作为密码

GRANT ALL PRIVILEGES ON dk.* TO 'user'@'192.168.1.8' IDENTIFIED BY 'password' WITH GRANT OPTION;

FLUSH   PRIVILEGES;

]
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics