SQL語句及5.7.2 mysql 使用者管理

來源:互聯網
上載者:User

標籤:text   user   idp   rom   登入   rop   ica   刪除   class   

一、使用者的定義1.1 使用者名稱+主機域

此處為5.7.2版本的mysql當中password欄位已改為authentication_string
mysql> select user,host,authentication_string from user;

+---------------+-----------+-------------------------------------------+| user          | host      | authentication_string                     |+---------------+-----------+-------------------------------------------+| root          | localhost | *5B11E7BC48365F1019E05077EBDC42BA908B3342 || mysql.session | localhost | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE || mysql.sys     | localhost | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE || shiqi         | %         | *5B11E7BC48365F1019E05077EBDC42BA908B3342 || shiqi         | localhost | *5B11E7BC48365F1019E05077EBDC42BA908B3342 |+---------------+-----------+-------------------------------------------+5 rows in set (0.02 sec)
1.2 使用者作用

1.2.1 登入資料庫

   登入命令為:mysql -u username -p 然後輸入密碼
1.2.2 管理資料庫和維護資料

1.3 串連資料庫

   定義使用者:使用者名稱+主機域,密碼
   定義許可權:對不同的對象進行許可權(角色)定義

命令:
grant authority on target_zone to ‘user‘ identified by ‘password‘

許可權內容(authority):
   增刪改查
   insert update、select、delete、drop、create

許可權 權限等級 許可權說明
CREATE 資料庫、表或索引 建立資料庫、表或索引許可權
DROP 資料庫或表 刪除資料庫或表許可權
GRANT OPTION 資料庫、表或儲存的程式 賦予許可權選項
REFERENCES 資料庫或表
ALTER 更改表,比如添加欄位、索引等
DELETE 刪除資料許可權
INDEX 索引許可權
INSERT 插入許可權
SELECT 查詢許可權
UPDATE 更新許可權

SQL語句及5.7.2 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.