3 回答
TA贡献1869条经验 获得超4个赞
错误1130(HY000):主机‘1.2.3.4’不允许连接到此MySQL服务器
vim /etc/mysql/my.cnf
#bind-address = 127.0.0.1#skip-networking
~ /etc/init.d/mysql restart
USERNAME
PASSWORD
mysql> GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'%' IDENTIFIED BY 'PASSWORD' WITH GRANT OPTION;
USERNAME
PASSWORD
mysql> GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'1.2.3.4' IDENTIFIED BY 'PASSWORD' WITH GRANT OPTION;
USERNAME
& PASSWORD
SELECT * from information_schema.user_privileges where grantee like "'USERNAME'%";
mysql> FLUSH PRIVILEGES;
mysql -h HOST -u USERNAME -pPASSWORD
mysql> REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'USERNAME'@'%';Following will revoke all options for USERNAME from particular IP:mysql> REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'USERNAME'@'1.2.3.4'; Its better to check information_schema.user_privileges table after running REVOKE command.
TA贡献1890条经验 获得超9个赞
#nano /etc/mysql/my.cnf
...... ..... # Instead of skip-networking the default is now to listen only on# localhost which is more compatible and is not less secure.bind-address = 127.0.0.1 bind-address = 192.168.0.116..... ......
stop mysqlstart mysql
#/etc/init.d/mysql restart
mysql -u username -h 192.168.0.116 -p
添加回答
举报