我正在尝试远程连接到 MySQL 服务器,如下所示:
下面的代码工作正常
mysql -u root -h localhost -p
下面的代码给我一个错误
mysql -u root -h 'server ip_address here' -p
ERROR 1130 (00000): Host xxx is not allowed to connect to this MySQL server
请帮忙
我正在尝试远程连接到 MySQL 服务器,如下所示:
下面的代码工作正常
mysql -u root -h localhost -p
下面的代码给我一个错误
mysql -u root -h 'server ip_address here' -p
ERROR 1130 (00000): Host xxx is not allowed to connect to this MySQL server
请帮忙
必须通过 phpMyAdmin 或命令提示符创建new MySQL User
并分配如下权限:Query prompt
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' WITH GRANT OPTION;
CREATE USER 'username'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' WITH GRANT OPTION;
一旦完成所有四个查询,它应该连接到username / password
RESTART WAMP / LAMP Server
它应该工作!
只需运行以下两个命令
GRANT ALL PRIVILEGES ON *.* TO '**YourUserName**'@'**your IP**' IDENTIFIED BY '**yourPassoword**';
flush PRIVILEGES;
会好的,继续:)