mysql使用者權限操作

來源:互聯網
上載者:User

標籤:into   sele   查看   ant   drop   oca   val   使用者權限   密碼   

mysql使用者權限操作
1.建立使用者
mysql -uroot
create database zabbix default charset utf8;
grant all on zabbix.* to [email protected] identified by ‘zabbix‘;
#查看許可權
show grants for [email protected];
use mysql;
select * from user where User=‘zabbix‘\G
select Host,User from user where User=‘zabbix‘;


2.設定密碼
3.更改許可權

#建立user4使用者,並授權和配置密碼
GRANT SELECT,INSERT ON d3307.* TO [email protected]‘192.168.52‘ IDENTIFIED BY ‘user0523‘;
#查看使用者的對應許可權
SELECT * FROM mysql.`db` where user=‘user4‘\G


#CREATE建立使用者
create user ‘aaa01‘@‘localhost‘ identified by ‘aaa01‘,‘bbb01‘@‘localhost‘ identified by ‘bbb01‘;
#INSERT建立使用者
INSERT INTO mysql.user(Host,User,Password,ssl_cipher,x509_issuer,x509_subject) VALUES(‘%’,’newuser1’,PASSWORD(‘123456’),”,”,”);
FLUSH PRIVILEGES;
#GRANT建立使用者
grant select,insert on db01.* to ‘aaa02‘@‘localhost‘ identified by ‘aaa02‘;

#DROP刪除使用者
drop user ‘aaa01‘@‘localhost‘;
#DELETE刪除使用者
DELETE FROM mysql.user WHERE Host = ‘%’ AND User = ‘admin’;

mysql使用者權限操作

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.