mysql 用户授权授权_mysql的用户权限如何授权
mysql的用戶權(quán)限如何授權(quán)
發(fā)布時(shí)間:2020-06-02 17:24:55
來(lái)源:51CTO
閱讀:211
作者:三月
下面一起來(lái)了解下mysql的用戶權(quán)限如何授權(quán),相信大家看完肯定會(huì)受益匪淺,文字在精不在多,希望mysql的用戶權(quán)限如何授權(quán)這篇短內(nèi)容是你想要的。
mysql> grant 權(quán)限1,權(quán)限2,…權(quán)限n on 數(shù)據(jù)庫(kù)名稱.表名稱 to 用戶名@用戶地址 identified by ‘連接口令’;
權(quán)限1,權(quán)限2,…權(quán)限n代表select,insert,update,delete,create,drop,index,alter,grant,references,reload,shutdown,process,file等14個(gè)權(quán)限。
當(dāng)權(quán)限1,權(quán)限2,…權(quán)限n被all privileges或者all代替,表示賦予用戶全部權(quán)限。
當(dāng)數(shù)據(jù)庫(kù)名稱.表名稱被.代替,表示賦予用戶操作云服務(wù)器上所有數(shù)據(jù)庫(kù)所有表的權(quán)限。
用戶地址可以是localhost,也可以是ip地址、機(jī)器名字、域名。也可以用’%'表示從任何地址連接。
‘連接口令’不能為空,否則創(chuàng)建失敗。
mysql>grant select,insert,update,delete,create,drop on vtdc.employee to joe@10.163.225.87 identified by ‘123′;
給來(lái)自10.163.225.87的用戶joe分配可對(duì)數(shù)據(jù)庫(kù)vtdc的employee表進(jìn)行select,insert,update,delete,create,drop等操作的權(quán)限,并設(shè)定口令為123。
mysql>grant all privileges on vtdc.* to joe@10.163.225.87 identified by ‘123′;
給來(lái)自10.163.225.87的用戶joe分配可對(duì)數(shù)據(jù)庫(kù)vtdc所有表進(jìn)行所有操作的權(quán)限,并設(shè)定口令為123。
mysql>grant all privileges on . to joe@10.163.225.87 identified by ‘123′;
給來(lái)自10.163.225.87的用戶joe分配可對(duì)所有數(shù)據(jù)庫(kù)的所有表進(jìn)行所有操作的權(quán)限,并設(shè)定口令為123。
mysql>grant all privileges on . to joe@localhost identified by ‘123′;
給本機(jī)用戶joe分配可對(duì)所有數(shù)據(jù)庫(kù)的所有表進(jìn)行所有操作的權(quán)限,并設(shè)定口令為123。
grant all privileges on . to root@'192.168.0.%' identified by '123456'
grant all privileges on . to root@'211.149.231.21' identified by 'Uk8F$4_^6';
flush privileges;
grant all privileges on . to root@'106.75.28.32' identified by 'yj123456';
flush privileges;
grant all privileges on . to root@'%' identified by 'dev_pwd';
flush privileges;
看完mysql的用戶權(quán)限如何授權(quán)這篇文章后,很多讀者朋友肯定會(huì)想要了解更多的相關(guān)內(nèi)容,如需獲取更多的行業(yè)信息,可以關(guān)注我們的行業(yè)資訊欄目。
總結(jié)
以上是生活随笔為你收集整理的mysql 用户授权授权_mysql的用户权限如何授权的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: Android之旅---广播(Broad
- 下一篇: mysql查看授权_mysql查看用户授