遠程用戶連接mysql授權
授權法:www.2cto.com
在安裝mysql的機器上運行:
1、d:\mysql\bin\>mysql -h localhost -u root
//這樣應該可以進入MySQL服務器
2、mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'WITH GRANT OPTION
//賦予任何主機訪問數據的權限
例如,你想myuser使用mypassword從任何主機連接到mysql服務器的話。
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%'IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
如果你想允許用戶myuser從ip為192.168.1.6的主機連接到mysql服務器,並使用mypassword作為密碼
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3'IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
3、mysql>FLUSH PRIVILEGES
//修改生效
4、mysql>EXIT