2012-08-03 74 views
1

我打算設置一個遠程mysql用戶,可以從IP(192.168.1.100〜192.168.1.255)訪問mysql。遠程MySQL連接範圍IP

我嘗試下面的命令:

GRANT select ON *.* TO 'uname'@'192.168.1.%' IDENTIFIED BY 'some_pass' WITH GRANT OPTION; 

問題是,它允許從192.168.1.1到192.168.1.99的IP了。

所以,我想這一個:

GRANT select ON *.* TO 'uname'@'192.168.1.100/25' IDENTIFIED BY 'some_pass' WITH GRANT OPTION; 

相同的結果。任何建議?

非常感謝!

回答

2
GRANT select ON . TO 'uname'@'192.168.1.1__' IDENTIFIED BY 'some_pass' WITH GRANT OPTION; 
GRANT select ON . TO 'uname'@'192.168.1.2__' IDENTIFIED BY 'some_pass' WITH GRANT OPTION; 
+0

非常感謝! – 2012-08-03 05:12:20