mysql 用户授权授权_mysql的用户权限如何授权
mysql的用戶權限如何授權
發布時間:2020-06-02 17:24:55
來源:51CTO
閱讀:211
作者:三月
下面一起來了解下mysql的用戶權限如何授權,相信大家看完肯定會受益匪淺,文字在精不在多,希望mysql的用戶權限如何授權這篇短內容是你想要的。
mysql> grant 權限1,權限2,…權限n on 數據庫名稱.表名稱 to 用戶名@用戶地址 identified by ‘連接口令’;
權限1,權限2,…權限n代表select,insert,update,delete,create,drop,index,alter,grant,references,reload,shutdown,process,file等14個權限。
當權限1,權限2,…權限n被all privileges或者all代替,表示賦予用戶全部權限。
當數據庫名稱.表名稱被.代替,表示賦予用戶操作云服務器上所有數據庫所有表的權限。
用戶地址可以是localhost,也可以是ip地址、機器名字、域名。也可以用’%'表示從任何地址連接。
‘連接口令’不能為空,否則創建失敗。
mysql>grant select,insert,update,delete,create,drop on vtdc.employee to joe@10.163.225.87 identified by ‘123′;
給來自10.163.225.87的用戶joe分配可對數據庫vtdc的employee表進行select,insert,update,delete,create,drop等操作的權限,并設定口令為123。
mysql>grant all privileges on vtdc.* to joe@10.163.225.87 identified by ‘123′;
給來自10.163.225.87的用戶joe分配可對數據庫vtdc所有表進行所有操作的權限,并設定口令為123。
mysql>grant all privileges on . to joe@10.163.225.87 identified by ‘123′;
給來自10.163.225.87的用戶joe分配可對所有數據庫的所有表進行所有操作的權限,并設定口令為123。
mysql>grant all privileges on . to joe@localhost identified by ‘123′;
給本機用戶joe分配可對所有數據庫的所有表進行所有操作的權限,并設定口令為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的用戶權限如何授權這篇文章后,很多讀者朋友肯定會想要了解更多的相關內容,如需獲取更多的行業信息,可以關注我們的行業資訊欄目。
總結
以上是生活随笔為你收集整理的mysql 用户授权授权_mysql的用户权限如何授权的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Android之旅---广播(Broad
- 下一篇: 时间格式化需要注意点不可使用本地时间