msyql開啟遠端訪問許可權

2021-10-09 06:05:08 字數 443 閱讀 4483

1、確定已經開放了3306埠(預設埠)

如果沒有開啟,則使用輸入命令:

/sbin/iptables -i input -p tcp --dport 3306 -j accept

更多方法可以參考:

linux開放指定埠命令

2、進入資料庫,執行:

grant all privileges on . to 『root』@』%』 identified by 『mypassword』 with grant option;

當然,在這之前,你首先要保證mysql.user表中host欄位有一條為%。

3、如果以上都已經做好了,就繼續執行:

flush privileges;

mysql開啟遠端訪問許可權

1.改表法 登入資料庫 mysql u root pvmwaremysql use mysql 為所有ip都可以遠端訪問 mysql update user set host where user root 或直接新增一條語句也行 mysql insert into user host,user,p...

mysql開啟遠端訪問許可權

雲伺服器 ecs 伺服器上輸入 ps ef grep mysqld mysqld safe和mysqld都在,說明mysql程序是正常,若沒有這兩程序,執行 etc init.d mysqld start,啟動msyql。使用 netstat anpt 監聽得位址如果是 3306或者是0.0.0.0...

mysql開啟遠端訪問許可權

1.登入mysql mysql uroot p2.進入mysql資料庫use mysql3.檢視許可權select user,host from user 可以看到許可權都是localhost 4.修改許可權 root 是使用者名稱,123456 是填寫密碼的位置 grant all privile...