mysql補遺3

來源:互聯網
上載者:User
小結許可權的相關操作

1 建立帳號
  grant all privileges on *.* to z1@localhost;
       *.*表示對本地所有資料庫及表都有許可權,可以改為on test.user ,則對test資料庫的user表有許可權。
  限制IP及加上密碼
  grant select,insert,update..... on test1.* to 'z1'@'localhost' identified by '密碼'
也可以用 on test.* to 'z1'@'%',表示可以從任意主機串連過去。

2 只授予某使用者登陸許可權,其他什麼都看不到
  grant usage on *.* to 'z4'@'localhost';
3  查看某使用者有的許可權
    show grants from z1@localhost;
  查看Z1使用者的許可權。
4 收回許可權
  revoke select,insert on *.* from z2@localhost;

5 安全原則
  A 不要用root帳號登陸
  B 除root外,任何使用者不應該有mysql庫和user表庫的許可權
  C 不要把file,process或super許可權授予管理員以外的帳號

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.