Mysql允許外網(wǎng)訪問設(shè)置的方法:首先打開mysql輸入密碼,并輸入【use mysql】;然后創(chuàng)建host,并授權(quán)用戶;最后以用戶root和密碼pwd連接到mysql服務(wù)器。
Mysql允許外網(wǎng)訪問設(shè)置的方法:
1、打開mysql.exe(MySQL Command Line Client),輸入密碼
2、輸入:use mysql;
3、查詢host輸入: select user,host from user;
4、創(chuàng)建host(如果有"%"這個(gè)host值,則跳過這一步)
如果沒有"%"這個(gè)host值,就執(zhí)行下面這兩句:
mysql> update user set host='%' where user='root'; mysql> flush privileges;
5、授權(quán)用戶
(1)任意主機(jī)以用戶root和密碼pwd連接到mysql服務(wù)器
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'pwd' WITH GRANT OPTION; mysql> flush privileges;
(2)指定IP為(如192.168.1.100)的主機(jī)以用戶tuser和密碼tpwd連接到mysql服務(wù)器
mysql> GRANT ALL PRIVILEGES ON *.* TO 'tuser'@'192.168.1.100' IDENTIFIED BY 'tpwd' WITH GRANT OPTION; mysql> flush privileges;