亚洲激情专区-91九色丨porny丨老师-久久久久久久女国产乱让韩-国产精品午夜小视频观看

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

mysql grant配置授權

發布時間:2020-03-04 09:22:32 來源:網絡 閱讀:742 作者:wx5be582d51c2c5 欄目:云計算

新建一個用戶admin1對所有的庫表完全權限,允許從任何地方訪問,密碼設為123456
Query OK, 0 rows affected, 1 warning (0.00 sec)
語法為

grant 權限列表 on 庫名.表名 用戶名@“用戶地址” identified by " 密碼" [ with grant opion ];

mysql> grant all on . to admin2@"%" identified by "123456" with grant option;
Query OK, 0 rows affected, 1 warning (0.00 sec)
all 匹配所有權限
. 匹配所有庫和表
” %“ 匹配所有主機

授權用戶admin3 允許對192.168.4.0/24網段訪問

mysql> grant all on . to admin3@'192.168.4.0/24' identified by "123456" with grant option;
Query OK, 0 rows affected, 1 warning (0.00 sec)

對用戶admin4在daydb4.user1僅有查詢權限 登錄密碼為123456
mysql> grant select on daydb4.user1 to admin4@"localhost" identified by "123456" with grant option;
Query OK, 0 rows affected, 1 warning (0.00 sec)

授權admin5 允許本機訪問,對daydb4任何表有查詢 更改 插入 刪除 權限 密碼123456

mysql> grant select,update,delete,insert on daydb4.* to admin4@"localhost" identified by "123456" with grant option;
Query OK, 0 rows affected, 1 warning (0.01 sec)

用戶查看自己的授權

mysql> show grants;

+---------------------------------------------------------------------+
| Grants for root@localhost |
+---------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON . TO 'root'@'localhost' WITH GRANT OPTION |
| GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION |
+---------------------------------------------------------------------+
2 rows in set (0.00 sec)

root 查看其他人用戶的授權
show grant for 用戶名@“客戶端地址”;

mysql> show grants for admin4@"localhost" \g;
+----------------------------------------------------------------------------------------------+
| Grants for admin4@localhost |
+----------------------------------------------------------------------------------------------+
| GRANT USAGE ON . TO 'admin4'@'localhost' |
| GRANT SELECT, INSERT, UPDATE, DELETE ON daydb4.* TO 'admin4'@'localhost' WITH GRANT OPTION |
| GRANT SELECT ON daydb4.user1 TO 'admin4'@'localhost' WITH GRANT OPTION |
+----------------------------------------------------------------------------------------------+
3 rows in set (0.00 sec)
用戶鏈接后修改密碼
set password=password("新密碼");

[root@MySQL50 ~]# mysql -uadmin4 -p654321
[root@MySQL50 ~]# mysql -uadmin4 -p654321
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 41
Server version: 5.7.17 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>
mysql> set password=password("123456");
Query OK, 0 rows affected, 1 warning (0.00 sec)

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

新泰市| 建水县| 启东市| 富平县| 凤冈县| 青浦区| 雷山县| 砀山县| 鹤庆县| 辉南县| 赤壁市| 芒康县| 西城区| 宁都县| 兴文县| 绿春县| 龙里县| 宁强县| 腾冲县| 于田县| 通渭县| 涞水县| 伊宁县| 乌什县| 米易县| 莱西市| 岳西县| 乌拉特前旗| 汪清县| 仲巴县| 信阳市| 法库县| 牟定县| 肥西县| 申扎县| 随州市| 临潭县| 东丰县| 海口市| 西吉县| 保德县|