mysql 遠端訪問 許可權

2021-09-22 17:17:33 字數 1119 閱讀 2093

5.mysql安裝之後,使使用者可以從其它位址可以訪問伺服器

首先得修改/etc/mysql/my.cnf檔案,將

bind-address = 127.0.0.1

修改為bind-address = 0.0.0.0

然後得建立遠端訪問的使用者,並賦予其訪問許可權

建立使用者並且賦予許可權,實際上有好幾種方法。這裡使用我個人最喜歡的方式,一部到位,需要進入到mysql之後執行命令

指令碼如下:

grant

on[object] [identified by

'password']

[with

grant

option];

max_queries_per_hour count

max_updates_per_hour count

max_connections_per_hour count

max_user_connections count

說明:priv代表許可權select,insert,update,delete,create,drop,index,alter,grant,references,reload,shutdown,process,file等14個許可權

示例:grant

select,insert,update,delete,create,drop

on test.hr to [email protected]

.10.1 identified by

'123';

表示為使用者john建立從位址192.168.10.1對資料庫test的hr表進行select,insert,update,delete,create,drop的許可權,其密碼為123

grant

select,insert,update,delete,create,drop

on *.* to john@'%' identified by

'123';

表示為使用者john建立從任何遠端位址對資料庫的所有庫和表進行select,insert,update,delete,create,drop的許可權,其密碼為123

執行完後需要重新整理許可權:

flush privileges;

mysql 遠端訪問 許可權

5.mysql安裝之後,使使用者可以從其它位址可以訪問伺服器 首先得修改 etc mysql my.cnf檔案,將 bind address 127.0.0.1 修改為bind address 0.0.0.0 然後得建立遠端訪問的使用者,並賦予其訪問許可權 建立使用者並且賦予許可權,實際上有好幾種方...

mysql 遠端 MYSQL開啟遠端訪問許可權的方法

1 登陸mysql資料庫 mysql u root p 檢視user表 mysql use mysql database changed mysql select host,user,password from user host user password localhost root a731a...

MySQL新增遠端訪問許可權

給遠端連線許可權 問題 遠端連線mysql資料庫出現 error 1130 host root is not allowed to connect to this mysql server 錯誤時解決方法!修改root的許可權 use mysql select host from user wher...