91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

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

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

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

黔江区| 隆德县| 霞浦县| 陇西县| 措美县| 柳河县| 白河县| 鄱阳县| 轮台县| 岳阳市| 岳普湖县| 神木县| 万年县| 林甸县| 红原县| 锦州市| 大田县| 布拖县| 丹棱县| 吉隆县| 盐边县| 玛多县| 中西区| 山丹县| 银川市| 合作市| 吉首市| 鄱阳县| 石楼县| 吴旗县| 井研县| 富阳市| 永和县| 镇雄县| 天台县| 裕民县| 茶陵县| 图木舒克市| 江都市| 兴安县| 中宁县|