@zabbix web登录忘记密码(用户密码重置及反解)


在这里插入图片描述

1.zabbix web登录

zabbix部署后,使用默认的Admin账户登录
Admin/zabbix,新部署搭建的zabbix环境,密码都为Admin

假设:
1》web账户密码忘记了,且zabbix无存档,这是就把自己关外面了,无法进入到zabbix工作台里,这也是极端的 情况
2》管理员用户禁用登录,创建的普通用户,权限不够,无法操作所需求的功能,这时也就需要重置用户权限及密码了

在这里插入图片描述

2.数据库重置zabbix web用户

#数据登录
[root@mysql01 ~]# mysql -uroot -pZabbix@2021**
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 5339639
Server version: 5.7.36-log MySQL Community Server (GPL)

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

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> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
| zabbix             |
+--------------------+
5 rows in set (0.00 sec)






#查看zabbix库的容量
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
| zabbix             |
+--------------------+
5 rows in set (0.00 sec)

mysql> select table_schema, sum(data_length+index_length)/1024/1024 as total_mb,  sum(data_length)/1024/1024 as data_mb, sum(index_length)/1024/1024 as index_mb,  count(*) as tables, curdate() as today from information_schema.tables group by table_schema order by 2 desc;
+--------------------+---------------+---------------+--------------+--------+------------+
| table_schema       | total_mb      | data_mb       | index_mb     | tables | today      |
+--------------------+---------------+---------------+--------------+--------+------------+
| zabbix             | 2492.20312500 | 1843.10937500 | 649.09375000 |    149 | 2022-08-04 |
| mysql              |    2.77200603 |    2.51126385 |   0.26074219 |     31 | 2022-08-04 |
| information_schema |    0.15625000 |    0.15625000 |   0.00000000 |     61 | 2022-08-04 |
| sys                |    0.01562500 |    0.01562500 |   0.00000000 |    101 | 2022-08-04 |
| performance_schema |    0.00000000 |    0.00000000 |   0.00000000 |     87 | 2022-08-04 |
+--------------------+---------------+---------------+--------------+--------+------------+
5 rows in set (0.07 sec)





#单个库的容量查询
mysql> select concat(truncate(sum(data_length)/1024/1024,2),'mb') as data_size,  concat(truncate(sum(max_data_length)/1024/1024,2),'mb') as max_data_size,  concat(truncate(sum(data_free)/1024/1024,2),'mb') as data_free,  concat(truncate(sum(index_length)/1024/1024,2),'mb') as index_size  from information_schema.tables where table_schema = 'zabbix';
+-----------+---------------+-----------+------------+
| data_size | max_data_size | data_free | index_size |
+-----------+---------------+-----------+------------+
| 1843.10mb | 0.00mb        | 224.00mb  | 649.09mb   |
+-----------+---------------+-----------+------------+
1 row in set (0.01 sec)


#查看容量大小
mysql> select  table_schema as '数据库', sum(table_rows) as '记录数', sum(truncate(data_length/1024/1024, 2)) as '数据容量(MB)', sum(truncate(index_length/1024/1024,
2)) as '索引容量(MB)' from information_schema.tables where table_schema='zabbix';
+-----------+-----------+------------------+------------------+
| 数据库    | 记录数    | 数据容量(MB)     | 索引容量(MB)     |
+-----------+-----------+------------------+------------------+
| zabbix    |  18286395 |          1842.28 |           648.56 |
+-----------+-----------+------------------+------------------+
1 row in set (0.02 sec)






mysql> use zabbix;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed


#查看zabbix数据库所有表
mysql> show tables;
+----------------------------+
| Tables_in_zabbix           |
+----------------------------+
| acknowledges               |
| actions                    |
| alerts                     |
| application_discovery      |
| application_prototype      |
| application_template       |
| applications               |
| auditlog                   |
| auditlog_details           |
| autoreg_host               |
| conditions                 |
| config                     |
| config_autoreg_tls         |
| corr_condition             |
| corr_condition_group       |
| corr_condition_tag         |
| corr_condition_tagpair     |
| corr_condition_tagvalue    |
| corr_operation             |
| correlation                |
| dashboard                  |
| dashboard_user             |
| dashboard_usrgrp           |
| dbversion                  |
| dchecks                    |
| dhosts                     |
| drules                     |
| dservices                  |
| escalations                |
| event_recovery             |
| event_suppress             |
| event_tag                  |
| events                     |
| expressions                |
| functions                  |
| globalmacro                |
| globalvars                 |
| graph_discovery            |
| graph_theme                |
| graphs                     |
| graphs_items               |
| group_discovery            |
| group_prototype            |
| history                    |
| history_log                |
| history_str                |
| history_text               |
| history_uint               |
| host_discovery             |
| host_inventory             |
| host_tag                   |
| hostmacro                  |
| hosts                      |
| hosts_groups               |
| hosts_templates            |
| housekeeper                |
| hstgrp                     |
| httpstep                   |
| httpstep_field             |
| httpstepitem               |
| httptest                   |
| httptest_field             |
| httptestitem               |
| icon_map                   |
| icon_mapping               |
| ids                        |
| images                     |
| interface                  |
| interface_discovery        |
| item_application_prototype |
| item_condition             |
| item_discovery             |
| item_preproc               |
| item_rtdata                |
| items                      |
| items_applications         |
| lld_macro_path             |
| maintenance_tag            |
| maintenances               |
| maintenances_groups        |
| maintenances_hosts         |
| maintenances_windows       |
| mappings                   |
| media                      |
| media_type                 |
| media_type_param           |
| opcommand                  |
| opcommand_grp              |
| opcommand_hst              |
| opconditions               |
| operations                 |
| opgroup                    |
| opinventory                |
| opmessage                  |
| opmessage_grp              |
| opmessage_usr              |
| optemplate                 |
| problem                    |
| problem_tag                |
| profiles                   |
| proxy_autoreg_host         |
| proxy_dhistory             |
| proxy_history              |
| regexps                    |
| rights                     |
| screen_user                |
| screen_usrgrp              |
| screens                    |
| screens_items              |
| scripts                    |
| service_alarms             |
| services                   |
| services_links             |
| services_times             |
| sessions                   |
| slides                     |
| slideshow_user             |
| slideshow_usrgrp           |
| slideshows                 |
| sysmap_element_trigger     |
| sysmap_element_url         |
| sysmap_shape               |
| sysmap_url                 |
| sysmap_user                |
| sysmap_usrgrp              |
| sysmaps                    |
| sysmaps_elements           |
| sysmaps_link_triggers      |
| sysmaps_links              |
| tag_filter                 |
| task                       |
| task_acknowledge           |
| task_check_now             |
| task_close_problem         |
| task_remote_command        |
| task_remote_command_result |
| timeperiods                |
| trends                     |
| trends_uint                |
| trigger_depends            |
| trigger_discovery          |
| trigger_tag                |
| triggers                   |
| users                      |
| users_groups               |
| usrgrp                     |
| valuemaps                  |
| widget                     |
| widget_field               |
+----------------------------+
149 rows in set (0.00 sec)



#查看users表的内容
mysql> select * from users\G
*************************** 1. row ***************************
        userid: 1
         alias: Admin
          name: Zabbix
       surname: Administrator
        passwd: 5fce1b3e34b520afeffb37ce08c7cd66
           url: 
     autologin: 0
    autologout: 30m
          lang: zh_CN
       refresh: 30s
          type: 3
         theme: dark-theme
attempt_failed: 0
    attempt_ip: 10.21.1.88
 attempt_clock: 1643014668
 rows_per_page: 50
*************************** 2. row ***************************
        userid: 2
         alias: guest
          name: 
       surname: 
        passwd: d41d8cd98f00b204e9800998ecf8427e
           url: 
     autologin: 0
    autologout: 15m
          lang: en_GB
       refresh: 30s
          type: 1
         theme: default
attempt_failed: 0
    attempt_ip: 
 attempt_clock: 0
 rows_per_page: 50
2 rows in set (0.00 sec)

mysql> 


mysql> select * from users;
+--------+-------+--------+---------------+----------------------------------+-----+-----------+------------+-------+---------+------+------------+----------------+------------+---------------+---------------+
| userid | alias | name   | surname       | passwd                           | url | autologin | autologout | lang  | refresh | type | theme      | attempt_failed | attempt_ip | attempt_clock | rows_per_page |
+--------+-------+--------+---------------+----------------------------------+-----+-----------+------------+-------+---------+------+------------+----------------+------------+---------------+---------------+
|      1 | Admin | Zabbix | Administrator | 5fce1b3e34b520afeffb37ce08c7cd66 |     |         0 | 30m        | zh_CN | 30s     |    3 | dark-theme |              0 | 10.21.1.88 |    1643014668 |            50 |
|      2 | guest |        |               | d41d8cd98f00b204e9800998ecf8427e |     |         0 | 15m        | en_GB | 30s     |    1 | default    |              0 |            |             0 |            50 |
+--------+-------+--------+---------------+----------------------------------+-----+-----------+------------+-------+---------+------+------------+----------------+------------+---------------+---------------+
2 rows in set (0.00 sec)

3.查看数据库容量

1#进去指定schema 数据库(存放了所有的数据库的一些信息)
mysql> use information_schema;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed



2#查询所有库容量使用大小 
mysql> select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from TABLES;
+-----------+
| data      |
+-----------+
| 1845.79MB |
+-----------+
1 row in set (0.05 sec)



3#查看指定数据库zabbix的使用容量
mysql> select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from TABLES where table_schema='zabbix';
+-----------+
| data      |
+-----------+
| 1843.11MB |
+-----------+
1 row in set (0.01 sec)



4#查看指定数据库的表使用大小,如数据库 zabbix 中的 hosts 表和users表使用量 
mysql> select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from TABLES where table_schema='zabbix' and table_name='users';
+--------+
| data   |
+--------+
| 0.02MB |
+--------+
1 row in set (0.00 sec)

mysql> select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from TABLES where table_schema='zabbix' and table_name='hosts';
+--------+
| data   |
+--------+
| 0.09MB |
+--------+
1 row in set (0.00 sec)




5#查看数据库中表的使用状态
mysql> SELECT CONCAT(table_schema,'.',table_name) AS 'Table Name', CONCAT(ROUND(table_rows/1000000,4),'M') AS 'Number of Rows', CONCAT(ROUND(data_length/(1024*1024*1024),4),'G') AS 'Data Size', CONCAT(ROUND(index_length/(1024*1024*1024),4),'G') AS 'Index Size', CONCAT(ROUND((data_length+index_length)/(1024*1024*1024),4),'G') AS'Total'FROM information_schema.TABLES WHERE table_schema LIKE 'zabbix';
+-----------------------------------+----------------+-----------+------------+---------+
| Table Name                        | Number of Rows | Data Size | Index Size | Total   |
+-----------------------------------+----------------+-----------+------------+---------+
| zabbix.acknowledges               | 0.0000M        | 0.0000G   | 0.0000G    | 0.0001G |
| zabbix.actions                    | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.alerts                     | 0.0142M        | 0.0064G   | 0.0026G    | 0.0090G |
| zabbix.application_discovery      | 0.0001M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.application_prototype      | 0.0001M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.application_template       | 0.0004M        | 0.0000G   | 0.0000G    | 0.0001G |
| zabbix.applications               | 0.0009M        | 0.0001G   | 0.0000G    | 0.0001G |
| zabbix.auditlog                   | 0.0025M        | 0.0003G   | 0.0002G    | 0.0005G |
| zabbix.auditlog_details           | 0.0005M        | 0.0001G   | 0.0000G    | 0.0001G |
| zabbix.autoreg_host               | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.conditions                 | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.config                     | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.config_autoreg_tls         | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.corr_condition             | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.corr_condition_group       | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.corr_condition_tag         | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.corr_condition_tagpair     | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.corr_condition_tagvalue    | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.corr_operation             | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.correlation                | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.dashboard                  | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.dashboard_user             | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.dashboard_usrgrp           | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.dbversion                  | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.dchecks                    | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.dhosts                     | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.drules                     | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.dservices                  | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.escalations                | 0.0000M        | 0.0000G   | 0.0000G    | 0.0001G |
| zabbix.event_recovery             | 0.0082M        | 0.0004G   | 0.0004G    | 0.0008G |
| zabbix.event_suppress             | 0.0000M        | 0.0000G   | 0.0000G    | 0.0001G |
| zabbix.event_tag                  | 0.0005M        | 0.0000G   | 0.0000G    | 0.0001G |
| zabbix.events                     | 0.0158M        | 0.0025G   | 0.0019G    | 0.0044G |
| zabbix.expressions                | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.functions                  | 0.0059M        | 0.0004G   | 0.0004G    | 0.0007G |
| zabbix.globalmacro                | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.globalvars                 | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.graph_discovery            | 0.0002M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.graph_theme                | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.graphs                     | 0.0008M        | 0.0002G   | 0.0001G    | 0.0003G |
| zabbix.graphs_items               | 0.0025M        | 0.0002G   | 0.0002G    | 0.0004G |
| zabbix.group_discovery            | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.group_prototype            | 0.0000M        | 0.0000G   | 0.0000G    | 0.0001G |
| zabbix.history                    | 3.1639M        | 0.2717G   | 0.1281G    | 0.3998G |
| zabbix.history_log                | 0.0001M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.history_str                | 0.7946M        | 0.0421G   | 0.0225G    | 0.0646G |
| zabbix.history_text               | 0.0004M        | 0.0029G   | 0.0000G    | 0.0030G |
| zabbix.history_uint               | 9.5987M        | 1.1289G   | 0.4707G    | 1.5996G |
| zabbix.host_discovery             | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.host_inventory             | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.host_tag                   | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.hostmacro                  | 0.0007M        | 0.0001G   | 0.0001G    | 0.0002G |
| zabbix.hosts                      | 0.0002M        | 0.0001G   | 0.0001G    | 0.0002G |
| zabbix.hosts_groups               | 0.0002M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.hosts_templates            | 0.0002M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.housekeeper                | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.hstgrp                     | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.httpstep                   | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.httpstep_field             | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.httpstepitem               | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.httptest                   | 0.0000M        | 0.0000G   | 0.0001G    | 0.0001G |
| zabbix.httptest_field             | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.httptestitem               | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.icon_map                   | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.icon_mapping               | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.ids                        | 0.0001M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.images                     | 0.0001M        | 0.0015G   | 0.0000G    | 0.0015G |
| zabbix.interface                  | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.interface_discovery        | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.item_application_prototype | 0.0009M        | 0.0001G   | 0.0001G    | 0.0002G |
| zabbix.item_condition             | 0.0009M        | 0.0001G   | 0.0000G    | 0.0001G |
| zabbix.item_discovery             | 0.0037M        | 0.0003G   | 0.0003G    | 0.0006G |
| zabbix.item_preproc               | 0.0058M        | 0.0004G   | 0.0002G    | 0.0006G |
| zabbix.item_rtdata                | 0.0030M        | 0.0002G   | 0.0000G    | 0.0002G |
| zabbix.items                      | 0.0067M        | 0.0043G   | 0.0021G    | 0.0065G |
| zabbix.items_applications         | 0.0055M        | 0.0003G   | 0.0004G    | 0.0007G |
| zabbix.lld_macro_path             | 0.0001M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.maintenance_tag            | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.maintenances               | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.maintenances_groups        | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.maintenances_hosts         | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.maintenances_windows       | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.mappings                   | 0.0011M        | 0.0001G   | 0.0000G    | 0.0001G |
| zabbix.media                      | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.media_type                 | 0.0000M        | 0.0001G   | 0.0000G    | 0.0001G |
| zabbix.media_type_param           | 0.0001M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.opcommand                  | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.opcommand_grp              | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.opcommand_hst              | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.opconditions               | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.operations                 | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.opgroup                    | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.opinventory                | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.opmessage                  | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.opmessage_grp              | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.opmessage_usr              | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.optemplate                 | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.problem                    | 0.0001M        | 0.0000G   | 0.0000G    | 0.0001G |
| zabbix.problem_tag                | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.profiles                   | 0.0006M        | 0.0001G   | 0.0001G    | 0.0002G |
| zabbix.proxy_autoreg_host         | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.proxy_dhistory             | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.proxy_history              | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.regexps                    | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.rights                     | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.screen_user                | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.screen_usrgrp              | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.screens                    | 0.0001M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.screens_items              | 0.0002M        | 0.0000G   | 0.0000G    | 0.0001G |
| zabbix.scripts                    | 0.0000M        | 0.0000G   | 0.0000G    | 0.0001G |
| zabbix.service_alarms             | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.services                   | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.services_links             | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.services_times             | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.sessions                   | 0.0001M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.slides                     | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.slideshow_user             | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.slideshow_usrgrp           | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.slideshows                 | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.sysmap_element_trigger     | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.sysmap_element_url         | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.sysmap_shape               | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.sysmap_url                 | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.sysmap_user                | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.sysmap_usrgrp              | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.sysmaps                    | 0.0000M        | 0.0000G   | 0.0001G    | 0.0001G |
| zabbix.sysmaps_elements           | 0.0000M        | 0.0000G   | 0.0001G    | 0.0001G |
| zabbix.sysmaps_link_triggers      | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.sysmaps_links              | 0.0000M        | 0.0000G   | 0.0000G    | 0.0001G |
| zabbix.tag_filter                 | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.task                       | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.task_acknowledge           | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.task_check_now             | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.task_close_problem         | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.task_remote_command        | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.task_remote_command_result | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.timeperiods                | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.trends                     | 1.0489M        | 0.0792G   | 0.0000G    | 0.0792G |
| zabbix.trends_uint                | 3.6046M        | 0.2524G   | 0.0000G    | 0.2524G |
| zabbix.trigger_depends            | 0.0014M        | 0.0001G   | 0.0001G    | 0.0002G |
| zabbix.trigger_discovery          | 0.0008M        | 0.0001G   | 0.0000G    | 0.0001G |
| zabbix.trigger_tag                | 0.0001M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.triggers                   | 0.0028M        | 0.0024G   | 0.0003G    | 0.0027G |
| zabbix.users                      | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.users_groups               | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.usrgrp                     | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.valuemaps                  | 0.0001M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.widget                     | 0.0000M        | 0.0000G   | 0.0000G    | 0.0000G |
| zabbix.widget_field               | 0.0001M        | 0.0000G   | 0.0001G    | 0.0001G |
+-----------------------------------+----------------+-----------+------------+---------+
149 rows in set (0.01 sec)

mysql> 



mysql> select 
    -> table_schema as '数据库',
    -> table_name as '表名',
    -> table_rows as '记录数',
    -> truncate(data_length/1024/1024, 2) as '数据容量(MB)',
    -> truncate(index_length/1024/1024, 2) as '索引容量(MB)'
    -> from information_schema.tables
    -> where table_schema='mysql'
    -> order by data_length desc, index_length desc;
+-----------+---------------------------+-----------+------------------+------------------+
| 数据库    | 表名                      | 记录数    | 数据容量(MB)     | 索引容量(MB)     |
+-----------+---------------------------+-----------+------------------+------------------+
| mysql     | help_topic                |      1114 |             1.51 |             0.09 |
| mysql     | proc                      |        48 |             0.28 |             0.00 |
| mysql     | innodb_index_stats        |      1367 |             0.26 |             0.00 |
| mysql     | help_keyword              |       746 |             0.10 |             0.10 |
| mysql     | help_relation             |      1505 |             0.09 |             0.00 |
| mysql     | help_category             |        50 |             0.01 |             0.01 |
| mysql     | slave_relay_log_info      |         0 |             0.01 |             0.00 |
| mysql     | slave_master_info         |         0 |             0.01 |             0.00 |
| mysql     | servers                   |         0 |             0.01 |             0.00 |
| mysql     | server_cost               |         6 |             0.01 |             0.00 |
| mysql     | engine_cost               |         2 |             0.01 |             0.00 |
| mysql     | innodb_table_stats        |       151 |             0.01 |             0.00 |
| mysql     | time_zone_transition_type |         0 |             0.01 |             0.00 |
| mysql     | time_zone_name            |         0 |             0.01 |             0.00 |
| mysql     | time_zone_leap_second     |         0 |             0.01 |             0.00 |
| mysql     | time_zone_transition      |         0 |             0.01 |             0.00 |
| mysql     | time_zone                 |         0 |             0.01 |             0.00 |
| mysql     | plugin                    |         2 |             0.01 |             0.00 |
| mysql     | gtid_executed             |         0 |             0.01 |             0.00 |
| mysql     | slave_worker_info         |         0 |             0.01 |             0.00 |
| mysql     | db                        |         3 |             0.00 |             0.00 |
| mysql     | tables_priv               |         2 |             0.00 |             0.00 |
| mysql     | proxies_priv              |         1 |             0.00 |             0.00 |
| mysql     | user                      |         6 |             0.00 |             0.00 |
| mysql     | procs_priv                |         0 |             0.00 |             0.00 |
| mysql     | columns_priv              |         0 |             0.00 |             0.00 |
| mysql     | event                     |         0 |             0.00 |             0.00 |
| mysql     | func                      |         0 |             0.00 |             0.00 |
| mysql     | ndb_binlog_index          |         0 |             0.00 |             0.00 |
| mysql     | general_log               |         2 |             0.00 |             0.00 |
| mysql     | slow_log                  |         2 |             0.00 |             0.00 |
+-----------+---------------------------+-----------+------------------+------------------+
31 rows in set (0.00 sec)

mysql> 




#查看所有库容量大小
mysql> select 
    -> table_schema as '数据库',
    -> sum(table_rows) as '记录数',
    -> sum(truncate(data_length/1024/1024, 2)) as '数据容量(MB)',
    -> sum(truncate(index_length/1024/1024, 2)) as '索引容量(MB)'
    -> from information_schema.tables
    -> group by table_schema
    -> order by sum(data_length) desc, sum(index_length) desc;
+--------------------+-----------+------------------+------------------+
| 数据库             | 记录数    | 数据容量(MB)     | 索引容量(MB)     |
+--------------------+-----------+------------------+------------------+
| zabbix             |  18303632 |          1842.28 |           648.56 |
| mysql              |      5007 |             2.39 |             0.20 |
| information_schema |      NULL |             0.10 |             0.00 |
| sys                |         6 |             0.01 |             0.00 |
| performance_schema |   1373862 |             0.00 |             0.00 |
+--------------------+-----------+------------------+------------------+
5 rows in set (0.05 sec)

mysql> 



#查看所有库表的容量
mysql> select 
    -> table_schema as '数据库',
    -> table_name as '表名',
    -> table_rows as '记录数',
    -> truncate(data_length/1024/1024, 2) as '数据容量(MB)',
    -> truncate(index_length/1024/1024, 2) as '索引容量(MB)'
    -> from information_schema.tables
    -> order by data_length desc, index_length desc;
+--------------------+------------------------------------------------------+-----------+------------------+------------------+
| 数据库             | 表名                                                 | 记录数    | 数据容量(MB)     | 索引容量(MB)     |
+--------------------+------------------------------------------------------+-----------+------------------+------------------+
| zabbix             | history_uint                                         |   9602793 |          1156.01 |           482.01 |
| zabbix             | history                                              |   3164975 |           278.18 |           131.18 |
| zabbix             | trends_uint                                          |   3604592 |           258.50 |             0.00 |
| zabbix             | trends                                               |   1048887 |            81.14 |             0.00 |
| zabbix             | history_str                                          |    794947 |            43.06 |            23.07 |
| zabbix             | alerts                                               |     14235 |             6.51 |             2.65 |
| zabbix             | items                                                |      6654 |             4.45 |             2.18 |
| zabbix             | history_text                                         |       391 |             3.01 |             0.01 |
| zabbix             | events                                               |     15846 |             2.51 |             1.98 |
| zabbix             | triggers                                             |      2751 |             2.48 |             0.28 |
| mysql              | help_topic                                           |      1114 |             1.51 |             0.09 |
| zabbix             | images                                               |       138 |             1.51 |             0.01 |
| zabbix             | event_recovery                                       |      8167 |             0.45 |             0.40 |
| zabbix             | item_preproc                                         |      5814 |             0.45 |             0.20 |
| zabbix             | functions                                            |      5907 |             0.35 |             0.40 |
| zabbix             | item_discovery                                       |      3732 |             0.34 |             0.28 |
| zabbix             | items_applications                                   |      5527 |             0.32 |             0.42 |
| zabbix             | auditlog                                             |      2502 |             0.29 |             0.17 |
| mysql              | proc                                                 |        48 |             0.28 |             0.00 |
| mysql              | innodb_index_stats                                   |      1367 |             0.26 |             0.00 |
| zabbix             | graphs_items                                         |      2475 |             0.21 |             0.18 |
| zabbix             | item_rtdata                                          |      2971 |             0.18 |             0.00 |
| zabbix             | graphs                                               |       845 |             0.17 |             0.10 |
| zabbix             | trigger_depends                                      |      1362 |             0.10 |             0.12 |
| mysql              | help_keyword                                         |       746 |             0.10 |             0.10 |
| zabbix             | hosts                                                |       186 |             0.09 |             0.09 |
| zabbix             | hostmacro                                            |       745 |             0.09 |             0.07 |
| zabbix             | profiles                                             |       642 |             0.09 |             0.07 |
| zabbix             | item_condition                                       |       894 |             0.09 |             0.04 |
| zabbix             | media_type                                           |         9 |             0.09 |             0.01 |
| mysql              | help_relation                                        |      1505 |             0.09 |             0.00 |
| zabbix             | item_application_prototype                           |       940 |             0.07 |             0.10 |
| zabbix             | applications                                         |       879 |             0.07 |             0.04 |
| zabbix             | mappings                                             |      1101 |             0.07 |             0.04 |
| zabbix             | auditlog_details                                     |       456 |             0.07 |             0.01 |
| zabbix             | trigger_discovery                                    |       774 |             0.06 |             0.01 |
| zabbix             | application_template                                 |       416 |             0.04 |             0.03 |
| zabbix             | event_tag                                            |       452 |             0.04 |             0.01 |
| zabbix             | screens_items                                        |       211 |             0.04 |             0.01 |
| zabbix             | widget_field                                         |       134 |             0.01 |             0.09 |
| zabbix             | sysmaps_elements                                     |         0 |             0.01 |             0.07 |
| zabbix             | httptest                                             |         2 |             0.01 |             0.06 |
| zabbix             | sysmaps                                              |         0 |             0.01 |             0.06 |
| zabbix             | escalations                                          |        12 |             0.01 |             0.04 |
| zabbix             | group_prototype                                      |        14 |             0.01 |             0.04 |
| zabbix             | problem                                              |        92 |             0.01 |             0.04 |
| zabbix             | sysmaps_links                                        |         0 |             0.01 |             0.04 |
| zabbix             | acknowledges                                         |         7 |             0.01 |             0.04 |
| zabbix             | scripts                                              |         3 |             0.01 |             0.04 |
| zabbix             | event_suppress                                       |         0 |             0.01 |             0.04 |
| zabbix             | screen_usrgrp                                        |         0 |             0.01 |             0.03 |
| zabbix             | opgroup                                              |         0 |             0.01 |             0.03 |
| zabbix             | icon_map                                             |         0 |             0.01 |             0.03 |
| zabbix             | screen_user                                          |         0 |             0.01 |             0.03 |
| zabbix             | hosts_templates                                      |       190 |             0.01 |             0.03 |
| zabbix             | httptestitem                                         |         6 |             0.01 |             0.03 |
| zabbix             | dashboard_usrgrp                                     |         0 |             0.01 |             0.03 |
| zabbix             | sysmap_element_trigger                               |         0 |             0.01 |             0.03 |
| zabbix             | rights                                               |         0 |             0.01 |             0.03 |
| zabbix             | hosts_groups                                         |       185 |             0.01 |             0.03 |
| zabbix             | dashboard_user                                       |         1 |             0.01 |             0.03 |
| zabbix             | slideshows                                           |         0 |             0.01 |             0.03 |
| zabbix             | application_prototype                                |       140 |             0.01 |             0.03 |
| zabbix             | opcommand_hst                                        |         0 |             0.01 |             0.03 |
| zabbix             | users_groups                                         |         2 |             0.01 |             0.03 |
| zabbix             | slideshow_usrgrp                                     |         0 |             0.01 |             0.03 |
| zabbix             | media                                                |         2 |             0.01 |             0.03 |
| zabbix             | task                                                 |         0 |             0.01 |             0.03 |
| zabbix             | application_discovery                                |        84 |             0.01 |             0.03 |
| zabbix             | opcommand_grp                                        |         0 |             0.01 |             0.03 |
| zabbix             | httpstepitem                                         |         6 |             0.01 |             0.03 |
| zabbix             | correlation                                          |         0 |             0.01 |             0.03 |
| zabbix             | slideshow_user                                       |         0 |             0.01 |             0.03 |
| zabbix             | proxy_dhistory                                       |         0 |             0.01 |             0.03 |
| zabbix             | tag_filter                                           |         0 |             0.01 |             0.03 |
| zabbix             | slides                                               |         0 |             0.01 |             0.03 |
| zabbix             | maintenances_windows                                 |         0 |             0.01 |             0.03 |
| zabbix             | optemplate                                           |         0 |             0.01 |             0.03 |
| zabbix             | actions                                              |         5 |             0.01 |             0.03 |
| zabbix             | maintenances_hosts                                   |         0 |             0.01 |             0.03 |
| zabbix             | service_alarms                                       |         0 |             0.01 |             0.03 |
| zabbix             | config                                               |         0 |             0.01 |             0.03 |
| zabbix             | opmessage_usr                                        |         2 |             0.01 |             0.03 |
| zabbix             | interface                                            |        24 |             0.01 |             0.03 |
| zabbix             | dservices                                            |         2 |             0.01 |             0.03 |
| zabbix             | sysmaps_link_triggers                                |         0 |             0.01 |             0.03 |
| zabbix             | sysmap_usrgrp                                        |         0 |             0.01 |             0.03 |
| zabbix             | host_discovery                                       |         4 |             0.01 |             0.03 |
| zabbix             | maintenances_groups                                  |         0 |             0.01 |             0.03 |
| zabbix             | opmessage_grp                                        |         4 |             0.01 |             0.03 |
| zabbix             | drules                                               |         0 |             0.01 |             0.03 |
| zabbix             | sysmap_user                                          |         0 |             0.01 |             0.03 |
| zabbix             | services_links                                       |         0 |             0.01 |             0.03 |
| zabbix             | maintenances                                         |         0 |             0.01 |             0.03 |
| zabbix             | autoreg_host                                         |         0 |             0.01 |             0.03 |
| zabbix             | screens                                              |        53 |             0.01 |             0.03 |
| zabbix             | icon_mapping                                         |         0 |             0.01 |             0.03 |
| zabbix             | lld_macro_path                                       |        58 |             0.01 |             0.01 |
| zabbix             | widget                                               |        15 |             0.01 |             0.01 |
| zabbix             | sysmap_element_url                                   |         0 |             0.01 |             0.01 |
| zabbix             | history_log                                          |        59 |             0.01 |             0.01 |
| zabbix             | graph_theme                                          |         4 |             0.01 |             0.01 |
| zabbix             | operations                                           |        11 |             0.01 |             0.01 |
| zabbix             | valuemaps                                            |        99 |             0.01 |             0.01 |
| zabbix             | opconditions                                         |         0 |             0.01 |             0.01 |
| zabbix             | httptest_field                                       |         0 |             0.01 |             0.01 |
| zabbix             | usrgrp                                               |         5 |             0.01 |             0.01 |
| zabbix             | graph_discovery                                      |       229 |             0.01 |             0.01 |
| zabbix             | regexps                                              |         5 |             0.01 |             0.01 |
| zabbix             | dashboard                                            |         2 |             0.01 |             0.01 |
| mysql              | help_category                                        |        50 |             0.01 |             0.01 |
| zabbix             | proxy_history                                        |         0 |             0.01 |             0.01 |
| zabbix             | users                                                |         1 |             0.01 |             0.01 |
| zabbix             | globalmacro                                          |         0 |             0.01 |             0.01 |
| zabbix             | corr_condition                                       |         0 |             0.01 |             0.01 |
| zabbix             | corr_operation                                       |         0 |             0.01 |             0.01 |
| zabbix             | host_tag                                             |         5 |             0.01 |             0.01 |
| zabbix             | opcommand                                            |         0 |             0.01 |             0.01 |
| zabbix             | httpstep_field                                       |         0 |             0.01 |             0.01 |
| zabbix             | services                                             |         0 |             0.01 |             0.01 |
| zabbix             | config_autoreg_tls                                   |         0 |             0.01 |             0.01 |
| zabbix             | interface_discovery                                  |         0 |             0.01 |             0.01 |
| zabbix             | proxy_autoreg_host                                   |         0 |             0.01 |             0.01 |
| zabbix             | expressions                                          |        10 |             0.01 |             0.01 |
| zabbix             | media_type_param                                     |       123 |             0.01 |             0.01 |
| zabbix             | httpstep                                             |         2 |             0.01 |             0.01 |
| zabbix             | trigger_tag                                          |        79 |             0.01 |             0.01 |
| zabbix             | sessions                                             |       128 |             0.01 |             0.01 |
| zabbix             | hstgrp                                               |        20 |             0.01 |             0.01 |
| zabbix             | services_times                                       |         0 |             0.01 |             0.01 |
| zabbix             | conditions                                           |        26 |             0.01 |             0.01 |
| zabbix             | problem_tag                                          |        15 |             0.01 |             0.01 |
| zabbix             | dhosts                                               |         2 |             0.01 |             0.01 |
| zabbix             | group_discovery                                      |         0 |             0.01 |             0.01 |
| zabbix             | opmessage                                            |         9 |             0.01 |             0.01 |
| zabbix             | sysmap_url                                           |         0 |             0.01 |             0.01 |
| zabbix             | corr_condition_group                                 |         0 |             0.01 |             0.01 |
| zabbix             | maintenance_tag                                      |         0 |             0.01 |             0.01 |
| zabbix             | dchecks                                              |         0 |             0.01 |             0.01 |
| zabbix             | sysmap_shape                                         |         0 |             0.01 |             0.01 |
| mysql              | time_zone_name                                       |         0 |             0.01 |             0.00 |
| zabbix             | task_remote_command                                  |         0 |             0.01 |             0.00 |
| zabbix             | housekeeper                                          |         0 |             0.01 |             0.00 |
| mysql              | slave_master_info                                    |         0 |             0.01 |             0.00 |
| zabbix             | dbversion                                            |         0 |             0.01 |             0.00 |
| mysql              | time_zone_leap_second                                |         0 |             0.01 |             0.00 |
| zabbix             | task_close_problem                                   |         0 |             0.01 |             0.00 |
| mysql              | servers                                              |         0 |             0.01 |             0.00 |
| information_schema | ROUTINES                                             |      NULL |             0.01 |             0.00 |
| mysql              | time_zone                                            |         0 |             0.01 |             0.00 |
| zabbix             | task_check_now                                       |         0 |             0.01 |             0.00 |
| mysql              | server_cost                                          |         6 |             0.01 |             0.00 |
| information_schema | COLUMNS                                              |      NULL |             0.01 |             0.00 |
| information_schema | PARTITIONS                                           |      NULL |             0.01 |             0.00 |
| zabbix             | task_acknowledge                                     |         0 |             0.01 |             0.00 |
| zabbix             | globalvars                                           |         0 |             0.01 |             0.00 |
| information_schema | PARAMETERS                                           |      NULL |             0.01 |             0.00 |
| information_schema | VIEWS                                                |      NULL |             0.01 |             0.00 |
| mysql              | gtid_executed                                        |         0 |             0.01 |             0.00 |
| information_schema | PROCESSLIST                                          |      NULL |             0.01 |             0.00 |
| information_schema | OPTIMIZER_TRACE                                      |      NULL |             0.01 |             0.00 |
| information_schema | PLUGINS                                              |      NULL |             0.01 |             0.00 |
| information_schema | TRIGGERS                                             |      NULL |             0.01 |             0.00 |
| zabbix             | corr_condition_tagvalue                              |         0 |             0.01 |             0.00 |
| zabbix             | host_inventory                                       |         0 |             0.01 |             0.00 |
| mysql              | plugin                                               |         2 |             0.01 |             0.00 |
| zabbix             | corr_condition_tagpair                               |         0 |             0.01 |             0.00 |
| sys                | sys_config                                           |         6 |             0.01 |             0.00 |
| mysql              | engine_cost                                          |         2 |             0.01 |             0.00 |
| mysql              | innodb_table_stats                                   |       151 |             0.01 |             0.00 |
| zabbix             | corr_condition_tag                                   |         0 |             0.01 |             0.00 |
| mysql              | time_zone_transition_type                            |         0 |             0.01 |             0.00 |
| zabbix             | timeperiods                                          |         0 |             0.01 |             0.00 |
| zabbix             | ids                                                  |        50 |             0.01 |             0.00 |
| mysql              | slave_worker_info                                    |         0 |             0.01 |             0.00 |
| mysql              | time_zone_transition                                 |         0 |             0.01 |             0.00 |
| zabbix             | task_remote_command_result                           |         0 |             0.01 |             0.00 |
| information_schema | EVENTS                                               |      NULL |             0.01 |             0.00 |
| zabbix             | opinventory                                          |         0 |             0.01 |             0.00 |
| mysql              | slave_relay_log_info                                 |         0 |             0.01 |             0.00 |
| mysql              | db                                                   |         3 |             0.00 |             0.00 |
| mysql              | tables_priv                                          |         2 |             0.00 |             0.00 |
| mysql              | proxies_priv                                         |         1 |             0.00 |             0.00 |
| mysql              | user                                                 |         6 |             0.00 |             0.00 |
| mysql              | procs_priv                                           |         0 |             0.00 |             0.00 |
| mysql              | columns_priv                                         |         0 |             0.00 |             0.00 |
| mysql              | event                                                |         0 |             0.00 |             0.00 |
| mysql              | func                                                 |         0 |             0.00 |             0.00 |
| mysql              | ndb_binlog_index                                     |         0 |             0.00 |             0.00 |
| performance_schema | global_status                                        |       182 |             0.00 |             0.00 |
| information_schema | SCHEMA_PRIVILEGES                                    |      NULL |             0.00 |             0.00 |
| performance_schema | events_transactions_summary_by_user_by_event_name    |       128 |             0.00 |             0.00 |
| information_schema | INNODB_FT_CONFIG                                     |      NULL |             0.00 |             0.00 |
| information_schema | INNODB_SYS_TABLES                                    |      NULL |             0.00 |             0.00 |
| information_schema | ENGINES                                              |      NULL |             0.00 |             0.00 |
| performance_schema | table_io_waits_summary_by_table                      |      4096 |             0.00 |             0.00 |
| performance_schema | events_statements_summary_by_account_by_event_name   |     24704 |             0.00 |             0.00 |
| performance_schema | replication_applier_status_by_worker                 |      8192 |             0.00 |             0.00 |
| information_schema | INNODB_SYS_TABLESTATS                                |      NULL |             0.00 |             0.00 |
| performance_schema | setup_objects                                        |       128 |             0.00 |             0.00 |
| performance_schema | file_summary_by_instance                             |      4096 |             0.00 |             0.00 |
| information_schema | SCHEMATA                                             |      NULL |             0.00 |             0.00 |
| performance_schema | events_transactions_summary_by_thread_by_event_name  |       256 |             0.00 |             0.00 |
| information_schema | INNODB_SYS_DATAFILES                                 |      NULL |             0.00 |             0.00 |
| information_schema | INNODB_SYS_INDEXES                                   |      NULL |             0.00 |             0.00 |
| performance_schema | table_io_waits_summary_by_index_usage                |      8192 |             0.00 |             0.00 |
| performance_schema | events_statements_history_long                       |     10000 |             0.00 |             0.00 |
| performance_schema | replication_applier_status_by_coordinator            |       256 |             0.00 |             0.00 |
| information_schema | COLUMN_PRIVILEGES                                    |      NULL |             0.00 |             0.00 |
| performance_schema | events_stages_summary_by_account_by_event_name       |     19200 |             0.00 |             0.00 |
| information_schema | INNODB_SYS_FOREIGN_COLS                              |      NULL |             0.00 |             0.00 |
| information_schema | INNODB_SYS_FOREIGN                                   |      NULL |             0.00 |             0.00 |
| performance_schema | setup_instruments                                    |      1098 |             0.00 |             0.00 |
| performance_schema | file_summary_by_event_name                           |        80 |             0.00 |             0.00 |
| performance_schema | events_transactions_summary_by_host_by_event_name    |       128 |             0.00 |             0.00 |
| information_schema | INNODB_TRX                                           |      NULL |             0.00 |             0.00 |
| information_schema | INNODB_TEMP_TABLE_INFO                               |      NULL |             0.00 |             0.00 |
| performance_schema | events_statements_history                            |      2560 |             0.00 |             0.00 |
| performance_schema | replication_applier_status                           |       256 |             0.00 |             0.00 |
| performance_schema | table_handles                                        |      2048 |             0.00 |             0.00 |
| information_schema | INNODB_METRICS                                       |      NULL |             0.00 |             0.00 |
| information_schema | INNODB_SYS_COLUMNS                                   |      NULL |             0.00 |             0.00 |
| performance_schema | setup_consumers                                      |        15 |             0.00 |             0.00 |
| performance_schema | events_stages_history_long                           |     10000 |             0.00 |             0.00 |
| information_schema | REFERENTIAL_CONSTRAINTS                              |      NULL |             0.00 |             0.00 |
| performance_schema | events_transactions_summary_by_account_by_event_name |       128 |             0.00 |             0.00 |
| information_schema | INNODB_LOCKS                                         |      NULL |             0.00 |             0.00 |
| information_schema | INNODB_LOCK_WAITS                                    |      NULL |             0.00 |             0.00 |
| performance_schema | file_instances                                       |      4096 |             0.00 |             0.00 |
| performance_schema | events_statements_current                            |      2560 |             0.00 |             0.00 |
| performance_schema | replication_applier_configuration                    |       256 |             0.00 |             0.00 |
| information_schema | COLLATION_CHARACTER_SET_APPLICABILITY                |      NULL |             0.00 |             0.00 |
| performance_schema | status_by_user                                       |     23296 |             0.00 |             0.00 |
| performance_schema | memory_summary_by_user_by_event_name                 |     40960 |             0.00 |             0.00 |
| information_schema | INNODB_BUFFER_POOL_STATS                             |      NULL |             0.00 |             0.00 |
| performance_schema | setup_actors                                         |       128 |             0.00 |             0.00 |
| information_schema | TABLE_PRIVILEGES                                     |      NULL |             0.00 |             0.00 |
| performance_schema | events_waits_summary_by_instance                     |     20480 |             0.00 |             0.00 |
| performance_schema | events_stages_history                                |      2560 |             0.00 |             0.00 |
| information_schema | INNODB_FT_DELETED                                    |      NULL |             0.00 |             0.00 |
| information_schema | INNODB_SYS_TABLESPACES                               |      NULL |             0.00 |             0.00 |
| information_schema | PROFILING                                            |      NULL |             0.00 |             0.00 |
| performance_schema | events_transactions_history_long                     |     10000 |             0.00 |             0.00 |
| mysql              | slow_log                                             |         2 |             0.00 |             0.00 |
| information_schema | INNODB_BUFFER_PAGE_LRU                               |      NULL |             0.00 |             0.00 |
| performance_schema | events_waits_summary_global_by_event_name            |       434 |             0.00 |             0.00 |
| performance_schema | events_stages_summary_global_by_event_name           |       150 |             0.00 |             0.00 |
| performance_schema | prepared_statements_instances                        |         0 |             0.00 |             0.00 |
| information_schema | COLLATIONS                                           |      NULL |             0.00 |             0.00 |
| performance_schema | status_by_thread                                     |     46592 |             0.00 |             0.00 |
| performance_schema | memory_summary_by_thread_by_event_name               |     81920 |             0.00 |             0.00 |
| information_schema | INNODB_CMPMEM                                        |      NULL |             0.00 |             0.00 |
| performance_schema | session_variables                                    |       550 |             0.00 |             0.00 |
| information_schema | TABLE_CONSTRAINTS                                    |      NULL |             0.00 |             0.00 |
| performance_schema | events_waits_summary_by_host_by_event_name           |     55552 |             0.00 |             0.00 |
| performance_schema | events_stages_current                                |       256 |             0.00 |             0.00 |
| information_schema | INNODB_CMPMEM_RESET                                  |      NULL |             0.00 |             0.00 |
| information_schema | INNODB_FT_INDEX_CACHE                                |      NULL |             0.00 |             0.00 |
| performance_schema | events_transactions_history                          |      2560 |             0.00 |             0.00 |
| information_schema | USER_PRIVILEGES                                      |      NULL |             0.00 |             0.00 |
| performance_schema | events_statements_summary_global_by_event_name       |       193 |             0.00 |             0.00 |
| performance_schema | events_waits_summary_by_user_by_event_name           |     55552 |             0.00 |             0.00 |
| performance_schema | events_stages_summary_by_user_by_event_name          |     19200 |             0.00 |             0.00 |
| performance_schema | performance_timers                                   |         5 |             0.00 |             0.00 |
| information_schema | CHARACTER_SETS                                       |      NULL |             0.00 |             0.00 |
| performance_schema | status_by_host                                       |     23296 |             0.00 |             0.00 |
| mysql              | general_log                                          |         2 |             0.00 |             0.00 |
| performance_schema | memory_summary_by_host_by_event_name                 |     40960 |             0.00 |             0.00 |
| performance_schema | session_status                                       |       182 |             0.00 |             0.00 |
| information_schema | TABLESPACES                                          |      NULL |             0.00 |             0.00 |
| performance_schema | events_waits_summary_by_account_by_event_name        |     55552 |             0.00 |             0.00 |
| performance_schema | cond_instances                                       |       768 |             0.00 |             0.00 |
| information_schema | INNODB_CMP_PER_INDEX                                 |      NULL |             0.00 |             0.00 |
| information_schema | INNODB_FT_INDEX_TABLE                                |      NULL |             0.00 |             0.00 |
| performance_schema | events_statements_summary_by_user_by_event_name      |     24704 |             0.00 |             0.00 |
| performance_schema | events_waits_summary_by_thread_by_event_name         |    111104 |             0.00 |             0.00 |
| information_schema | KEY_COLUMN_USAGE                                     |      NULL |             0.00 |             0.00 |
| performance_schema | events_transactions_current                          |       256 |             0.00 |             0.00 |
| performance_schema | variables_by_thread                                  |    140800 |             0.00 |             0.00 |
| performance_schema | status_by_account                                    |     23296 |             0.00 |             0.00 |
| performance_schema | events_stages_summary_by_thread_by_event_name        |     38400 |             0.00 |             0.00 |
| performance_schema | objects_summary_global_by_type                       |      5120 |             0.00 |             0.00 |
| performance_schema | session_connect_attrs                                |    131072 |             0.00 |             0.00 |
| information_schema | TABLES                                               |      NULL |             0.00 |             0.00 |
| performance_schema | events_waits_history_long                            |     10000 |             0.00 |             0.00 |
| performance_schema | accounts                                             |       128 |             0.00 |             0.00 |
| information_schema | INNODB_CMP_RESET                                     |      NULL |             0.00 |             0.00 |
| information_schema | INNODB_FT_DEFAULT_STOPWORD                           |      NULL |             0.00 |             0.00 |
| performance_schema | memory_summary_by_account_by_event_name              |     40960 |             0.00 |             0.00 |
| performance_schema | events_statements_summary_by_thread_by_event_name    |     49408 |             0.00 |             0.00 |
| performance_schema | replication_group_members                            |         0 |             0.00 |             0.00 |
| information_schema | GLOBAL_VARIABLES                                     |      NULL |             0.00 |             0.00 |
| performance_schema | users                                                |       128 |             0.00 |             0.00 |
| performance_schema | socket_summary_by_instance                           |       256 |             0.00 |             0.00 |
| performance_schema | events_stages_summary_by_host_by_event_name          |     19200 |             0.00 |             0.00 |
| performance_schema | mutex_instances                                      |     12288 |             0.00 |             0.00 |
| information_schema | STATISTICS                                           |      NULL |             0.00 |             0.00 |
| performance_schema | events_waits_history                                 |      2560 |             0.00 |             0.00 |
| information_schema | INNODB_FT_BEING_DELETED                              |      NULL |             0.00 |             0.00 |
| information_schema | INNODB_BUFFER_PAGE                                   |      NULL |             0.00 |             0.00 |
| performance_schema | hosts                                                |       128 |             0.00 |             0.00 |
| performance_schema | session_account_connect_attrs                        |    131072 |             0.00 |             0.00 |
| performance_schema | events_statements_summary_by_program                 |      1024 |             0.00 |             0.00 |
| performance_schema | replication_group_member_stats                       |         0 |             0.00 |             0.00 |
| information_schema | GLOBAL_STATUS                                        |      NULL |             0.00 |             0.00 |
| performance_schema | user_variables_by_thread                             |      2560 |             0.00 |             0.00 |
| performance_schema | socket_summary_by_event_name                         |        10 |             0.00 |             0.00 |
| performance_schema | metadata_locks                                       |         0 |             0.00 |             0.00 |
| performance_schema | events_waits_current                                 |      1536 |             0.00 |             0.00 |
| information_schema | INNODB_CMP                                           |      NULL |             0.00 |             0.00 |
| information_schema | INNODB_CMP_PER_INDEX_RESET                           |      NULL |             0.00 |             0.00 |
| performance_schema | host_cache                                           |       279 |             0.00 |             0.00 |
| performance_schema | rwlock_instances                                     |      3072 |             0.00 |             0.00 |
| information_schema | SESSION_VARIABLES                                    |      NULL |             0.00 |             0.00 |
| performance_schema | events_statements_summary_by_host_by_event_name      |     24704 |             0.00 |             0.00 |
| performance_schema | replication_connection_status                        |       256 |             0.00 |             0.00 |
| information_schema | FILES                                                |      NULL |             0.00 |             0.00 |
| performance_schema | threads                                              |       256 |             0.00 |             0.00 |
| performance_schema | socket_instances                                     |       256 |             0.00 |             0.00 |
| performance_schema | memory_summary_global_by_event_name                  |       320 |             0.00 |             0.00 |
| information_schema | INNODB_SYS_FIELDS                                    |      NULL |             0.00 |             0.00 |
| performance_schema | global_variables                                     |       550 |             0.00 |             0.00 |
| information_schema | SESSION_STATUS                                       |      NULL |             0.00 |             0.00 |
| performance_schema | events_transactions_summary_global_by_event_name     |         1 |             0.00 |             0.00 |
| information_schema | INNODB_SYS_VIRTUAL                                   |      NULL |             0.00 |             0.00 |
| performance_schema | table_lock_waits_summary_by_table                    |      4096 |             0.00 |             0.00 |
| performance_schema | events_statements_summary_by_digest                  |     10000 |             0.00 |             0.00 |
| performance_schema | replication_connection_configuration                 |       256 |             0.00 |             0.00 |
| performance_schema | setup_timers                                         |         5 |             0.00 |             0.00 |
| sys                | statements_with_runtimes_in_95th_percentile          |      NULL |             NULL |             NULL |
| sys                | memory_global_total                                  |      NULL |             NULL |             NULL |
| sys                | x$io_global_by_wait_by_bytes                         |      NULL |             NULL |             NULL |
| sys                | wait_classes_global_by_avg_latency                   |      NULL |             NULL |             NULL |
| sys                | x$schema_tables_with_full_table_scans                |      NULL |             NULL |             NULL |
| sys                | x$user_summary_by_statement_type                     |      NULL |             NULL |             NULL |
| sys                | io_global_by_file_by_latency                         |      NULL |             NULL |             NULL |
| sys                | schema_table_statistics_with_buffer                  |      NULL |             NULL |             NULL |
| sys                | statements_with_full_table_scans                     |      NULL |             NULL |             NULL |
| sys                | memory_global_by_current_bytes                       |      NULL |             NULL |             NULL |
| sys                | x$host_summary_by_statement_type                     |      NULL |             NULL |             NULL |
| sys                | x$io_global_by_file_by_latency                       |      NULL |             NULL |             NULL |
| sys                | version                                              |      NULL |             NULL |             NULL |
| sys                | x$schema_table_statistics_with_buffer                |      NULL |             NULL |             NULL |
| sys                | x$user_summary_by_statement_latency                  |      NULL |             NULL |             NULL |
| sys                | io_global_by_file_by_bytes                           |      NULL |             NULL |             NULL |
| sys                | schema_table_statistics                              |      NULL |             NULL |             NULL |
| sys                | statements_with_errors_or_warnings                   |      NULL |             NULL |             NULL |
| sys                | memory_by_user_by_current_bytes                      |      NULL |             NULL |             NULL |
| sys                | x$host_summary_by_statement_latency                  |      NULL |             NULL |             NULL |
| sys                | x$io_global_by_file_by_bytes                         |      NULL |             NULL |             NULL |
| sys                | x$schema_table_statistics                            |      NULL |             NULL |             NULL |
| sys                | user_summary_by_statement_type                       |      NULL |             NULL |             NULL |
| sys                | x$user_summary_by_stages                             |      NULL |             NULL |             NULL |
| sys                | io_by_thread_by_latency                              |      NULL |             NULL |             NULL |
| sys                | schema_table_lock_waits                              |      NULL |             NULL |             NULL |
| sys                | statement_analysis                                   |      NULL |             NULL |             NULL |
| sys                | x$host_summary_by_stages                             |      NULL |             NULL |             NULL |
| sys                | host_summary_by_file_io_type                         |      NULL |             NULL |             NULL |
| sys                | x$io_by_thread_by_latency                            |      NULL |             NULL |             NULL |
| sys                | user_summary_by_statement_latency                    |      NULL |             NULL |             NULL |
| sys                | x$schema_table_lock_waits                            |      NULL |             NULL |             NULL |
| sys                | innodb_lock_waits                                    |      NULL |             NULL |             NULL |
| sys                | user_summary_by_stages                               |      NULL |             NULL |             NULL |
| sys                | schema_redundant_indexes                             |      NULL |             NULL |             NULL |
| sys                | x$memory_global_total                                |      NULL |             NULL |             NULL |
| sys                | x$user_summary_by_file_io_type                       |      NULL |             NULL |             NULL |
| sys                | x$host_summary_by_file_io_type                       |      NULL |             NULL |             NULL |
| sys                | host_summary_by_file_io                              |      NULL |             NULL |             NULL |
| sys                | x$innodb_lock_waits                                  |      NULL |             NULL |             NULL |
| sys                | session_ssl_status                                   |      NULL |             NULL |             NULL |
| sys                | x$schema_index_statistics                            |      NULL |             NULL |             NULL |
| sys                | user_summary_by_file_io_type                         |      NULL |             NULL |             NULL |
| sys                | schema_object_overview                               |      NULL |             NULL |             NULL |
| sys                | x$memory_global_by_current_bytes                     |      NULL |             NULL |             NULL |
| sys                | x$user_summary_by_file_io                            |      NULL |             NULL |             NULL |
| sys                | innodb_buffer_stats_by_table                         |      NULL |             NULL |             NULL |
| sys                | x$host_summary_by_file_io                            |      NULL |             NULL |             NULL |
| sys                | host_summary                                         |      NULL |             NULL |             NULL |
| sys                | x$innodb_buffer_stats_by_table                       |      NULL |             NULL |             NULL |
| sys                | session                                              |      NULL |             NULL |             NULL |
| sys                | x$schema_flattened_keys                              |      NULL |             NULL |             NULL |
| sys                | user_summary_by_file_io                              |      NULL |             NULL |             NULL |
| sys                | schema_index_statistics                              |      NULL |             NULL |             NULL |
| sys                | x$memory_by_user_by_current_bytes                    |      NULL |             NULL |             NULL |
| sys                | x$user_summary                                       |      NULL |             NULL |             NULL |
| sys                | innodb_buffer_stats_by_schema                        |      NULL |             NULL |             NULL |
| sys                | x$innodb_buffer_stats_by_schema                      |      NULL |             NULL |             NULL |
| sys                | schema_unused_indexes                                |      NULL |             NULL |             NULL |
| sys                | x$host_summary                                       |      NULL |             NULL |             NULL |
| sys                | x$waits_global_by_latency                            |      NULL |             NULL |             NULL |
| sys                | memory_by_thread_by_current_bytes                    |      NULL |             NULL |             NULL |
| sys                | x$ps_schema_table_statistics_io                      |      NULL |             NULL |             NULL |
| sys                | user_summary                                         |      NULL |             NULL |             NULL |
| sys                | schema_auto_increment_columns                        |      NULL |             NULL |             NULL |
| sys                | x$memory_by_thread_by_current_bytes                  |      NULL |             NULL |             NULL |
| sys                | x$statements_with_temp_tables                        |      NULL |             NULL |             NULL |
| sys                | host_summary_by_statement_type                       |      NULL |             NULL |             NULL |
| sys                | waits_global_by_latency                              |      NULL |             NULL |             NULL |
| sys                | x$statements_with_full_table_scans                   |      NULL |             NULL |             NULL |
| sys                | memory_by_host_by_current_bytes                      |      NULL |             NULL |             NULL |
| sys                | x$ps_digest_avg_latency_distribution                 |      NULL |             NULL |             NULL |
| sys                | x$waits_by_user_by_latency                           |      NULL |             NULL |             NULL |
| sys                | x$memory_by_host_by_current_bytes                    |      NULL |             NULL |             NULL |
| sys                | x$statements_with_sorting                            |      NULL |             NULL |             NULL |
| sys                | host_summary_by_statement_latency                    |      NULL |             NULL |             NULL |
| sys                | ps_check_lost_instrumentation                        |      NULL |             NULL |             NULL |
| sys                | waits_by_user_by_latency                             |      NULL |             NULL |             NULL |
| sys                | x$statements_with_errors_or_warnings                 |      NULL |             NULL |             NULL |
| sys                | x$ps_digest_95th_percentile_by_avg_us                |      NULL |             NULL |             NULL |
| sys                | x$waits_by_host_by_latency                           |      NULL |             NULL |             NULL |
| sys                | latest_file_io                                       |      NULL |             NULL |             NULL |
| sys                | x$latest_file_io                                     |      NULL |             NULL |             NULL |
| sys                | x$statements_with_runtimes_in_95th_percentile        |      NULL |             NULL |             NULL |
| sys                | host_summary_by_stages                               |      NULL |             NULL |             NULL |
| sys                | statements_with_temp_tables                          |      NULL |             NULL |             NULL |
| sys                | processlist                                          |      NULL |             NULL |             NULL |
| sys                | waits_by_host_by_latency                             |      NULL |             NULL |             NULL |
| sys                | x$statement_analysis                                 |      NULL |             NULL |             NULL |
| sys                | x$processlist                                        |      NULL |             NULL |             NULL |
| sys                | x$wait_classes_global_by_latency                     |      NULL |             NULL |             NULL |
| sys                | io_global_by_wait_by_latency                         |      NULL |             NULL |             NULL |
| sys                | x$io_global_by_wait_by_latency                       |      NULL |             NULL |             NULL |
| sys                | statements_with_sorting                              |      NULL |             NULL |             NULL |
| sys                | metrics                                              |      NULL |             NULL |             NULL |
| sys                | wait_classes_global_by_latency                       |      NULL |             NULL |             NULL |
| sys                | x$session                                            |      NULL |             NULL |             NULL |
| sys                | schema_tables_with_full_table_scans                  |      NULL |             NULL |             NULL |
| sys                | x$wait_classes_global_by_avg_latency                 |      NULL |             NULL |             NULL |
| sys                | io_global_by_wait_by_bytes                           |      NULL |             NULL |             NULL |
+--------------------+------------------------------------------------------+-----------+------------------+------------------+
429 rows in set (0.08 sec)

mysql> 

3.数据库密码反解

【MD5在线加密及解密】

#查看当前数据zabbix web登录用户
root@mysql01 ~]# mysql -uroot -pZabbix@2021
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 5340112
Server version: 5.7.36-log MySQL Community Server (GPL)

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

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> use zabbix;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select * from users;
+--------+-------+--------+---------------+----------------------------------+-----+-----------+------------+-------+---------+------+------------+----------------+------------+---------------+---------------+
| userid | alias | name   | surname       | passwd                           | url | autologin | autologout | lang  | refresh | type | theme      | attempt_failed | attempt_ip | attempt_clock | rows_per_page |
+--------+-------+--------+---------------+----------------------------------+-----+-----------+------------+-------+---------+------+------------+----------------+------------+---------------+---------------+
|      1 | Admin | Zabbix | Administrator | 5fce1b3e34b520afeffb37ce08c7cd66 |     |         0 | 30m        | zh_CN | 30s     |    3 | dark-theme |              0 | 10.21.1.88 |    1643014668 |            50 |
|      2 | guest |        |               | d41d8cd98f00b204e9800998ecf8427e |     |         0 | 15m        | en_GB | 30s     |    1 | default    |              0 |            |             0 |            50 |
+--------+-------+--------+---------------+----------------------------------+-----+-----------+------------+-------+---------+------+------------+----------------+------------+---------------+---------------+
2 rows in set (0.00 sec)

反向解析MD5密文

在这里插入图片描述

MD5加密

在这里插入图片描述

4.手动生成MD5值

linux中生成MD5值

#可使用命令生成md5值
[root@mysql01 ~]# echo -n  zeny@2022  | openssl md5
(stdin)= fc08dbafb57c476ff5276746c87aa7be
[root@mysql01 ~]# 

5.手动更新zabbix用户users

#用户切换
mysql> use zabbix;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select * from users;
+--------+-------+--------+---------------+----------------------------------+-----+-----------+------------+-------+---------+------+------------+----------------+------------+---------------+---------------+
| userid | alias | name   | surname       | passwd                           | url | autologin | autologout | lang  | refresh | type | theme      | attempt_failed | attempt_ip | attempt_clock | rows_per_page |
+--------+-------+--------+---------------+----------------------------------+-----+-----------+------------+-------+---------+------+------------+----------------+------------+---------------+---------------+
|      1 | Admin | Zabbix | Administrator | 5fce1b3e34b520afeffb37ce08c7cd66 |     |         0 | 30m        | zh_CN | 30s     |    3 | dark-theme |              0 | 10.21.1.88 |    1643014668 |            50 |
|      2 | guest |        |               | d41d8cd98f00b204e9800998ecf8427e |     |         0 | 15m        | en_GB | 30s     |    1 | default    |              0 |            |             0 |            50 |
+--------+-------+--------+---------------+----------------------------------+-----+-----------+------------+-------+---------+------+------------+----------------+------------+---------------+---------------+
2 rows in set (0.00 sec)


#更新zabbix web用户登录密码
mysql> update users set  passwd='fc08dbafb57c476ff5276746c87aa7be' where userid = '1';
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.18 sec)

6.测试登录

在这里插入图片描述
在这里插入图片描述

posted @ 2022-08-11 22:52  ଲ一笑奈&何  阅读(337)  评论(0编辑  收藏  举报