mysql新增使用者和使用者許可權

2021-08-27 09:22:03 字數 1308 閱讀 7500

mysql新增使用者

使用可以對mysql資料庫使用者表有操作許可權的使用者名稱登陸mysql

insert into user(host,user,password) values('%','name','password');

如果work使用者沒有登陸許可權,則

killall mysqld

share/mysql/mysql.server start

grant all on *.* to work@'%' identified by "password";

mysql賦予使用者許可權的命令的簡單格式為

grant 許可權 on 資料庫物件 to 使用者

grant 許可權 on 資料庫物件 to 使用者 identified by "密碼"

使用者名稱:ad,密碼:ad_pass,登陸ip:192.168.0.10

//使用者在所有登陸ip的許可權

grant all on *.* to ad@『%』 identified by "ad_pass";

//開放管理mysql中所有資料庫的許可權

grant all on *.* to ad@'192.168.0.10' identified by "ad_pass";

//開放管理mysql中具體資料庫(test)的許可權

grant all privileges on test to ad@'192.168.0.10' identified by "ad_pass";

或grant all on test to ad@'192.168.0.10' identified by "ad_pass";

//開放管理mysql中具體資料庫中的表(test.table1)的許可權

grant all on test.table1 to ad@'192.168.0.10' identified by "ad_pass"

//開放管理mysql中具體資料庫的表(test.table1)的部分列的許可權

grant select(id,se,rank) on test.table1 to ad@'192.168.0.10' identified by "ad_pass";

//開放管理操作指令

grant select,insert,update,delete on test.* to ad@'192.168.0.10' identified by "ad_pass";

//**許可權

revoke all on *.* from ad@localhost;

//檢視mysql使用者許可權

show grants;

show grants for ad@localhost;

mysql新增使用者和使用者許可權

mysql新增使用者 使用可以對mysql資料庫使用者表有操作許可權的使用者名稱登陸mysql insert into user host,user,password values name password 如果work使用者沒有登陸許可權,則 killall mysqld share mysql...

mysql新增使用者和許可權

使用者管理 mysql use mysql 檢視 mysql select host,user,password from user 建立 mysql create user 使用者名稱identified by 使用者密碼 identified by 會將純文字密碼加密作為雜湊值儲存 使用者密碼要...

使用者許可權 mysql新增使用者及賦予許可權

建立使用者 use mysql 建立使用者需要操作 mysql 表 語法格式為 host host 為 localhost 表示本地登入使用者,host 為 ip位址或 ip 位址區間,表示指定ip位址的主機可登入,host 為 表示所有主機都可登入,省略代表所有主機create user user...