MySQL許可權分配

2022-02-13 03:05:02 字數 1046 閱讀 9284

1、給乙個資料庫分配唯讀賬號

grant select on `bstic`.* to 'readonly'@'%'  identified by "123456";

orgrant select on bstic.* to 'readonly'@'%'  identified by "123456";

2、多個資料庫分配唯讀許可權(只能單獨乙個乙個的分配)

grant select on *.* to 'yu'@'10.10.10.10' identified by '123456';

grant select on `bstic-1`.* to 'readonly'@'%'  identified by "123456";

grant select on `bstic-2`.* to 'readonly'@'%'  identified by "123456";

3、乙個資料庫讀寫許可權賬號

grant all privileges on `bstic`.* to 'yu'@'10.10.10.10' identified by '123456';

4、多個資料庫讀寫許可權賬號(只能單獨乙個乙個的分配)

grant all privileges on `bstic`.* to 'yu'@'10.10.10.10' identified by '123456';

grant all privileges on `bstic-1`.* to 'yu'@'10.10.10.10' identified by '123456';

5、其中乙個資料庫讀寫許可權,其他資料庫唯讀許可權

grant select on *.* to 'yu'@'10.10.10.10' identified by '123456';

grant all privileges on `bstic`.* to 'yu'@'10.10.10.10' identified by '123456';

6、命令列檢視使用者許可權

show grants for 'yu'@'%';

7、刪除使用者

drop user 'yu'@'localhost';

MySQL許可權分配

第一招 mysql服務的啟動和停止 net stop mysql net start mysql 第二招 登陸mysql 語法如下 mysql u使用者名稱 p使用者密碼 鍵入命令mysql uroot p,回車後提示你輸入密碼,輸入12345,然後回車即可進入到mysql中了,mysql的提示符是...

MySql許可權分配

mysql.user,mysql.db,mysql.table priv,mysql column priv grant select on mall.to dev 192.168.159.identified by 123 with grant option 建立乙個dev使用者,密碼為123,只...

mysql 建庫許可權 MySQL許可權分配

第一招 mysql服務的啟動和停止 net stop mysql net start mysql 第二招 登陸mysql 語法如下 mysql u使用者名稱 p使用者密碼 鍵入命令mysql uroot p,回車後提示你輸入密碼,輸入12345,然後回車即可進入到mysql中了,mysql的提示符是...