mysql添加使用者和使用者權限

來源:互聯網
上載者:User

標籤:

Mysql添加使用者
使用可以對mysql資料庫使用者表有操作許可權的使用者名稱登陸mysql
insert into user(Host,User,Password) values(‘%‘,‘name‘,‘password‘);
如果work使用者沒有登陸許可權,則
killall mysqld
share/mysql/mysql.server start
grant all on *.* to [email protected]‘%‘ identified by "password";



MySQL賦予使用者權限的命令的簡單格式為
grant 許可權 on 資料庫物件 to 使用者
grant 許可權 on 資料庫物件 to 使用者 identified by "密碼"

使用者名稱:ad,密碼:ad_pass,登陸ip:192.168.0.10
//使用者在所有登陸ip的許可權
grant all on *.* to [email protected]‘%’ identified by "ad_pass";

//開放管理MySQL中所有資料庫的許可權
grant all on *.* to [email protected]‘192.168.0.10‘ identified by "ad_pass";

//開放管理MySQL中具體資料庫(test)的許可權
grant all privileges on test to [email protected]‘192.168.0.10‘ identified by "ad_pass";

grant all on test to [email protected]‘192.168.0.10‘ identified by "ad_pass";

//開放管理MySQL中具體資料庫中的表(test.table1)的許可權
grant all on test.table1 to [email protected]‘192.168.0.10‘ identified by "ad_pass"

//開放管理MySQL中具體資料庫的表(test.table1)的部分列的許可權
grant select(id,se,rank) on test.table1 to [email protected]‘192.168.0.10‘ identified by "ad_pass";

//開放管理操作指令
grant select,insert,update,delete on test.* to [email protected]‘192.168.0.10‘ identified by "ad_pass";

//回收許可權
revoke all on *.* from [email protected];

//查看MySQL使用者權限
show grants;
show grants for [email protected];

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.