Mysql遠端連線被拒絕

2021-09-02 20:44:50 字數 622 閱讀 1838

遠端連線mysql資料庫時:

error 1045 (28000): access denied for user 'root'@'localhost' (using password: yes)

遠端連線被拒絕;

解決方法:

mysql> use mysql; 

database changed 

mysql> grant all privileges on *.* to 『youruser』@'%' identified by 『yourpassword』; 

query ok, 0 rows affected (0.00 sec) 

*.*標示所有資料庫下的所有表,』*』.*標示資料庫*下的所有表

mysql> grant all on *.* to 『youruser』@'%' identified by 『yourpassword』;

query ok, 0 rows affected (0.00 sec) 

%號出可以填寫允許訪問的ip位址或者主機名,%標示所有的ip

flush privileges;

query ok, 0 rows affected (0.00 sec) 

mysql> exit;

mysql遠端連線失敗被拒絕。

如果你想連線你的mysql的時候發生這個錯誤 error 1130 host 192.168.1.3 is not allowed to connect to this mysql server 1。改表法。可能是你的帳號不允許從遠端登陸,只能在localhost。這個時候只要在localhost的...

遠端連線linux上的mysql被拒絕

最近搞了一台阿里雲伺服器,裝上mysql之後,發現外部遠端連線mysql居然被拒絕了。新裝的mysql,並沒有要求設定密碼,所以無法正常登陸mysql。首先我強調一下,阿里雲上的安全組設定中3306端 已經釋放,並且linux上的3306埠也已經放開了。埠的原因,已經排除。主要是不知道mysql的初...

mysql遠端訪問被拒絕

以 root 賬號進入 mysql,use mysql grant allprivileges on to 某個使用者 identified by 使用者密碼 flush privileges 其中 是將所有的資料庫賦予某個使用者 也可以指定某個庫database.其中 是允許遠端連線的 ip 位址...