1. 程式人生 > >mysql 新增某個ip 允許訪問

mysql 新增某個ip 允許訪問

1. 測試是否允許遠端連線

$ telnet 192.168.1.8 3306
host 192.168.1.4 is not allowed to connect to this mysql server
2. 允許特定客戶端 ip 地址連線
$ mysql -u root -p
Enter password:

mysql> use mysql

mysql> GRANT ALL ON *.* to [email protected]'192.168.1.4' IDENTIFIED BY 'your-root-password'; 

mysql> FLUSH PRIVILEGES;
注意: your-root-password 填寫你的伺服器 mysql 的密碼