MYSQL新增遠端使用者或允許遠端訪問方法

2021-07-26 00:02:35 字數 443 閱讀 1621

mysql為了使用者的安全,系統預設的設定是不允許遠端使用者連線,只能本地的使用者連線。

只要我們設定下系統的管理員使用者的host這一項的值就可以給遠端的使用者訪問了。

% 代表任意的客戶端,如果填寫 localhost 為授權通過本地機訪問

新增乙個使用者admin並授權可從任何其它主機發起的訪問(萬用字元%),使用這一條語句即可。

mysql> grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;

query ok, 0 rows affected, 1 warning (0.01 sec)

mysql> flush privileges;

query ok, 0 rows affected (0.01 sec)

MYSQL新增遠端使用者或允許遠端訪問

mysql安裝完成之後,預設的就是不能遠端連線的,所以,不用糾結與吃驚 先以root使用者登入mysql,然後 grant allprivileges on to 建立的使用者名稱 identified by 密碼 flush privileges 可能你在許多的地方都看見了這個,但是你可能不知道為...

MYSQL新增遠端使用者或允許遠端訪問三種方法

新增遠端使用者admin密碼為password grant all privileges on to admin localhost identified by password with grant option grant all privileges on to admin identifie...

MYSQL新增遠端使用者或允許遠端訪問三種方法

mysql教程新增遠端使用者或允許遠端訪問三種方法 用root使用者登陸,然後 grant all privileges on to 建立的使用者名稱 identified by 密碼 flush privileges 重新整理剛才的內容 格式 grant 許可權 on 資料庫教程名.表名 to 使...