Chinaunix首页 | 论坛 | 博客
  • 博客访问: 369286
  • 博文数量: 174
  • 博客积分: 130
  • 博客等级: 入伍新兵
  • 技术积分: 587
  • 用 户 组: 普通用户
  • 注册时间: 2011-01-12 19:39
文章分类

全部博文(174)

文章存档

2018年(2)

2016年(10)

2015年(6)

2014年(31)

2013年(92)

2012年(33)

我的朋友

分类: LINUX

2013-07-26 13:57:37

查看MYSQL数据库中所有用户
mysql> SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM mysql.user;
+---------------------------------------+
| query                                 |
+---------------------------------------+
| User:
;                |
| User:
;              |
| User:
;                      |
| User:
;                     |
| User:
;                    |
| User:
;                   |
| User:
;             |
| User:
;           |
| User:
;       |
| User:
;  |
| User:
;       |
| User:
;                 |
| User:
;            |
| User:
;        |
| User:
;              |
| User:
;          |
| User:
;         |
| User:
;             |
| User:
;           |
| User:
;     |
| User:
; |
+---------------------------------------+
21 rows in set (0.01 sec)
 
查看数据库中具体某个用户的权限
mysql> show grants for
;   
+-------------------------------------------------------------------------------------------------------------------+
| Grants for
                                                                                            |
+-------------------------------------------------------------------------------------------------------------------+
| GRANT PROCESS, SUPER ON *.* TO
IDENTIFIED BY PASSWORD '*DAFF917B80E3314B1ABECBA9DF8785AFD342CE89' |
| GRANT ALL PRIVILEGES ON `cacti`.* TO
                                                              |
+-------------------------------------------------------------------------------------------------------------------+
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)
阅读(630) | 评论(0) | 转发(0) |
0

上一篇:ldconfig与 /etc/ld.so.conf

下一篇:makefile 文件

给主人留下些什么吧!~~