解決方法:
1、改表法:
可能是你的帳號不允許從遠端登陸,只能在localhost。這個時候只要在localhost的那台電腦,登入mysql後,更改 「mysql」 資料庫裡的 「user」 表裡的 「host」 項,從「localhost」改稱「%」
x:\>mysql -u root -pvmware
mysql> use mysql;
mysql> update user set host = 『%』 where user = 『root』;
mysql> select host, user from user;
mysql> flush privileges;
注:mysql> flush privileges; 使修改生效。
2、授權法:
例如,你想myuser使用mypassword從任何主機連線到mysql伺服器的話。
mysql> grant all privileges on *.* to identified by 『mypassword』 with grant option;
如果你想允許使用者myuser從ip為192.168.1.6的主機連線到mysql伺服器,並使用mypassword作為密碼
mysql> grant all privileges on *.* to 『myuser』@'192.168.1.3′ identified by 'mypassword』 with grant option;
mysql開啟遠端連線的方法
有時候需要遠端連線mysql資料庫,預設是不可以的,大家可以參考下面的方法,解決下。環境為centos6.5,mysql版本是mysql 5.5.35 1 在mysql服務所在主機上執行 mysql u root p mysql,系統提示輸入資料庫root使用者的密碼,輸入完成後即進入mysql控制...
mysql開啟遠端 mysql 開啟遠端連線
1045,access denied for user root 192.168.100.1 using password yes 開啟資料庫遠端連線即可 1 先在本機使用root使用者登入mysql,然後進行授權。mysql grant all privileges on to root iden...
開啟mysql遠端連線
首先新增使用者 當然也可是使用root使用者 格式 grant 許可權 on 資料庫名.表名 使用者 登入主機 identified by 使用者密碼 grant select,update,insert,delete on to zhxia identified by 123456 或者所有許可權...