中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

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

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

如何查看MYSQL數據庫中所有用戶及擁有權限

發布時間:2021-10-29 17:24:33 來源:億速云 閱讀:1658 作者:小新 欄目:MySQL數據庫

小編給大家分享一下如何查看MYSQL數據庫中所有用戶及擁有權限,希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!

查看MYSQL數據庫中所有用戶

mysql> SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM mysql.user;
+---------------------------------------+
| query                                 |
+---------------------------------------+
| User: 'cactiuser'@'%';                |
| User: 'common_user'@'%';              |
| User: 'dba'@'%';                      |
| User: 'root'@'%';                     |
| User: 'slave'@'%';                    |
| User: 'wtgame'@'%';                   |
| User: 'root'@'127.0.0.1';             |
| User: 'webman'@'127.0.0.1';           |
| User: 'root'@'192.168.166.200';       |
| User: 'cactiuser'@'192.168.166.202';  |
| User: 'root'@'192.168.166.202';       |
| User: ''@'localhost';                 |
| User: 'cacti'@'localhost';            |
| User: 'cactiuser'@'localhost';        |
| User: 'dba'@'localhost';              |
| User: 'extmail'@'localhost';          |
| User: 'javauser'@'localhost';         |
| User: 'root'@'localhost';             |
| User: 'webman'@'localhost';           |
| User: ''@'localhost.localdomain';     |
| User: 'root'@'localhost.localdomain'; |
+---------------------------------------+
21 rows in set (0.01 sec)

查看數據庫中具體某個用戶的權限
mysql> show grants for 'cactiuser'@'%';   
+-------------------------------------------------------------------------------------------------------------------+
| Grants for cactiuser@%                                                                                            |
+-------------------------------------------------------------------------------------------------------------------+
| GRANT PROCESS, SUPER ON *.* TO 'cactiuser'@'%' IDENTIFIED BY PASSWORD '*DAFF917B80E3314B1ABECBA9DF8785AFD342CE89' |
| GRANT ALL PRIVILEGES ON `cacti`.* TO 'cactiuser'@'%'                                                              |
+-------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

mysql> select * from mysql.user where user='cactiuser' \G  
*************************** 1. row ***************************
                 Host: %
                 User: cactiuser
             Password: *DAFF917B80E3314B1ABECBA9DF8785AFD342CE89
          Select_priv: N
          Insert_priv: N
          Update_priv: N
          Delete_priv: N
          Create_priv: N
            Drop_priv: N
          Reload_priv: N
        Shutdown_priv: N
         Process_priv: Y
            File_priv: N
           Grant_priv: N
      References_priv: N
           Index_priv: N
           Alter_priv: N
         Show_db_priv: N
           Super_priv: Y
Create_tmp_table_priv: N
     Lock_tables_priv: N
         Execute_priv: N
      Repl_slave_priv: N
     Repl_client_priv: N
     Create_view_priv: N
       Show_view_priv: N
  Create_routine_priv: N
   Alter_routine_priv: N
     Create_user_priv: N
           Event_priv: N
         Trigger_priv: N
             ssl_type:
           ssl_cipher:
          x509_issuer:
         x509_subject:
        max_questions: 0
          max_updates: 0
      max_connections: 0
 max_user_connections: 0

查看user表結構 需要具體的項可結合表結構來查詢
mysql> desc mysql.user;
+-----------------------+-----------------------------------+------+-----+---------+-------+
| Field                 | Type                              | Null | Key | Default | Extra |
+-----------------------+-----------------------------------+------+-----+---------+-------+
| Host                  | char(60)                          | NO   | PRI |         |       |
| User                  | char(16)                          | NO   | PRI |         |       |
| Password              | char(41)                          | NO   |     |         |       |
| Select_priv           | enum('N','Y')                     | NO   |     | N       |       |
******************
******************
+-----------------------+-----------------------------------+------+-----+---------+-------+
39 rows in set (0.00 sec)

看完了這篇文章,相信你對“如何查看MYSQL數據庫中所有用戶及擁有權限”有了一定的了解,如果想了解更多相關知識,歡迎關注億速云行業資訊頻道,感謝各位的閱讀!

向AI問一下細節

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

AI

建始县| 陆川县| 白河县| 枣强县| 湘潭市| 淮阳县| 额济纳旗| 洱源县| 永康市| 祁连县| 汕尾市| 时尚| 宿州市| 玛曲县| 卢湾区| 刚察县| 库车县| 井陉县| 凌海市| 静乐县| 乐平市| 松滋市| 哈尔滨市| 辽源市| 潜山县| 蛟河市| 万全县| 阿克苏市| 金塔县| 阳朔县| 沈丘县| 达拉特旗| 贺兰县| 株洲市| 泰来县| 安西县| 双桥区| 包头市| 徐闻县| 夏河县| 车险|