mysql資料庫使用者的建立,許可權分配,刪除等

來源:互聯網
上載者:User

標籤:地址   串連   code   images   roc   技術   revoke   使用者   update   

1.建立使用者

CREATE USER 使用者名稱@‘IP地址‘ identified by ‘密碼‘;
CREATE USER 使用者名稱@‘%‘ identified by ‘密碼‘;
ps:%表示所有id地址都能串連資料庫,添ip地址表示只有這個ip地址可以串連資料庫
**CREATE USER [email protected]‘%‘ identified by ‘123456‘;**

2.使用者授權

2.1 許可權分配
GRANT 許可權1,許可權2..... on 資料庫名. TO 使用者名稱 @IP地址或者%;
所有資料庫就用
.* 所有的許可權就用All或者All PRIVILEGES
ps:分配許可權後用 flush privileges 重新整理一下
GRANT select,insert,update,delete on blog. TO [email protected]‘%‘;
flush privileges

2.2.查看許可權

  • SHOW GRANTS FOR 使用者名稱@ip地址
    *` SHOW GRANTS FOR [email protected]‘%;`**

2.3.撤銷許可權
REVOKE 許可權1,許可權2...ON 資料庫名.* FROM 使用者名稱 @IP地址或者%;
*`REVOKE select,update On blog. FROM [email protected]‘%;`*
flush privileges

2.4.建立和授權一步搞定 &&&&&&&&&&&&&常用這個。。。。?
GRANT 許可權1,許可權2... ON 資料庫名.* TO 使用者名稱@ip地址 identified by ‘密碼‘;
*GRANT ALL ON blog. TO [email protected]‘%‘ identified by ‘123456‘;**
flush privileges 重新整理一下

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.