允許mysql遠端連線

2021-05-27 10:59:17 字數 594 閱讀 1799

1。 改表法。可能是你的帳號不允許從遠端登陸,只能在localhost。這個時候只要在localhost的那台電腦,登入mysql後,更改 "mysql" 資料庫裡的 "user" 表裡的 "host" 項,從"localhost"改稱"%"

mysql -u root -pvmwaremysql>use mysql;mysql>update user set host = '%' where user = 'root';mysql>select host, user from user;

2. 授權法。例如,你想myuser使用mypassword從任何主機連線到mysql伺服器的話。

grant all privileges on *.* to 'myuser'@'%' identified by 'mypassword' with grant option;

如果你想允許使用者myuser從ip為192.168.1.3的主機連線到mysql伺服器,並使用mypassword作為密碼

grant all privileges on *.* to 'root'@'192.168.1.3' identified by 'mypassword' with grant option;

mysql允許遠端連線

1。改表法。可能是你的帳號不允許從遠端登陸,只能在localhost。這個時候只要在localhost的那台電腦,登入mysql後,更改 mysql 資料庫裡的 user 表裡的 host 項,從 localhost 改稱 mysql u root pvmwaremysql use mysql my...

允許MySQL遠端連線

1.修改mysql配置檔案 etc mysql my.cnf 注釋以下行 bind address 127.0.0.1 2.重啟mysql資料庫,對於ubuntu系統,執行如下命令 sudo etc init.d mysql restart 3.以root使用者登入mysql後,執行如下命令 gra...

mysql允許遠端連線

1.3306埠是不是沒有開啟?使用nestat命令檢視3306埠狀態 netstat an grep 3306 tcp 0 0 127.0.0.1 3306 0.0.0.0 listen 從結果可以看出3306埠只是在ip 127.0.0.1上監聽,所以拒絕了其他ip的訪問。解決方法 修改 etc ...