当前位置:网站首页>information_schema
information_schema
2022-08-03 06:34:00 【51CTO】
server层统计
权限问题:
1、所有用户都有访问information_schema下的表权限(但只能看到这些表中用户具有访问权限的对象相对应的数据行),但只能访问Server层的部分数据字典表.
2、Server层中的部分数据字典表以及InnoDB层的数据字典表需要额外授权才能访问,如果用户权限不足,当查询Server层数据字典表时将不会返回任何数据,或者某个列没有权限访问时,该列返回NULL值。
3、当查询InnoDB数据字典表时将直接拒绝访问(要访问这些表需要有process权限,注意不是select权限)
4、从information_schema中查询相关数据需要的权限也适用于SHOW语句。无论使用哪种查询方式,都必须拥有某个对象的权限才能看到相关的数据。
####################
process和show
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
所有数据库详情
1 mysql> select * from SCHEMATA;
2 +--------------+--------------------+----------------------------+------------------------+----------+
3 | CATALOG_NAME | SCHEMA_NAME | DEFAULT_CHARACTER_SET_NAME | DEFAULT_COLLATION_NAME | SQL_PATH |
4 +--------------+--------------------+----------------------------+------------------------+----------+
5 | def | information_schema | utf8 | utf8_general_ci | NULL |
6 | def | apple | utf8mb4 | utf8mb4_general_ci | NULL |
7 | def | mysql | utf8mb4 | utf8mb4_general_ci | NULL |
8 | def | performance_schema | utf8 | utf8_general_ci | NULL |
9 | def | sys | utf8 | utf8_general_ci | NULL |
10 +--------------+--------------------+----------------------------+------------------------+----------+
11 5 rows in set (0.05 sec)
12
13
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
tables表:
[email protected] (information_schema) > desc tables;
+-----------------+---------------------+------+-----+---------+-------+
| field | type | null | key | default | extra |
+-----------------+---------------------+------+-----+---------+-------+
| table_catalog | varchar(512) | no | | | |
| table_schema | varchar(64) | no | | | | 数据库名称
| table_name | varchar(64) | no | | | | 表名称
| table_type | varchar(64) | no | | | | 表类型
| engine | varchar(64) | yes | | null | | 存储引擎
| version | bigint(21) unsigned | yes | | null | |
| row_format | varchar(20) | yes | | null | |
| table_rows | bigint(21) unsigned | yes | | null | | 行数
| avg_row_length | bigint(21) unsigned | yes | | null | |
| data_length | bigint(21) unsigned | yes | | null | | 数据大小
| max_data_length | bigint(21) unsigned | yes | | null | |
| index_length | bigint(21) unsigned | yes | | null | | 索引大小
| data_free | bigint(21) unsigned | yes | | null | |
| auto_increment | bigint(21) unsigned | yes | | null | | 自增长度
| create_time | datetime | yes | | null | | 创建时间
| update_time | datetime | yes | | null | | 更新时间
| check_time | datetime | yes | | null | |
| table_collation | varchar(32) | yes | | null | |
| checksum | bigint(21) unsigned | yes | | null | |
| create_options | varchar(255) | yes | | null | |
| table_comment | varchar(2048) | no | | | | 注释
+-----------------+---------------------+------+-----+---------+-------+
21 rows in set (0.00
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
- 23.
- 24.
- 25.
- 26.
- 27.
*************************** 19. row ***************************
TABLE_CATALOG: def
TABLE_SCHEMA: statistics
TABLE_NAME: user_2019_08
TABLE_TYPE: BASE TABLE
ENGINE: InnoDB
VERSION: 10
ROW_FORMAT: Compressed
TABLE_ROWS: 351716565
AVG_ROW_LENGTH: 37
DATA_LENGTH: 13293322240
MAX_DATA_LENGTH: 0
INDEX_LENGTH: 10047455232
DATA_FREE: 3670016
AUTO_INCREMENT: 381762867
CREATE_TIME: 2019-09-10 22:59:33
UPDATE_TIME: NULL
CHECK_TIME: NULL
TABLE_COLLATION: utf8_general_ci
CHECKSUM: NULL
CREATE_OPTIONS: row_format=COMPRESSED
TABLE_COMMENT: 原来的表已经很大了,新指标做在这张表里
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
所有存储引擎详情
1 mysql> select * from ENGINES order by ENGINE;
2 +--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
3 | ENGINE | SUPPORT | COMMENT | TRANSACTIONS | XA | SAVEPOINTS |
4 +--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
5 | ARCHIVE | YES | Archive storage engine | NO | NO | NO |
6 | BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO |
7 | CSV | YES | CSV storage engine | NO | NO | NO |
8 | FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL |
9 | InnoDB | DEFAULT | Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
10 | MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
11 | MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
12 | MyISAM | YES | MyISAM storage engine | NO | NO | NO |
13 | PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO |
14 +--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
15 9 rows in set (0.01 sec)
16
17
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
innodb层
锁、事务
1 mysql> show create table innodb_locks\G;
2 *************************** 1. row ***************************
3 Table: INNODB_LOCKS
4 Create Table: CREATE TEMPORARY TABLE `INNODB_LOCKS` (
5 `lock_id` varchar(81) NOT NULL DEFAULT '',
6 `lock_trx_id` varchar(18) NOT NULL DEFAULT '',
7 `lock_mode` varchar(32) NOT NULL DEFAULT '',
8 `lock_type` varchar(32) NOT NULL DEFAULT '',
9 `lock_table` varchar(1024) NOT NULL DEFAULT '',
10 `lock_index` varchar(1024) DEFAULT NULL,
11 `lock_space` bigint(21) unsigned DEFAULT NULL,
12 `lock_page` bigint(21) unsigned DEFAULT NULL,
13 `lock_rec` bigint(21) unsigned DEFAULT NULL,
14 `lock_data` varchar(8192) DEFAULT NULL
15 ) ENGINE=MEMORY DEFAULT CHARSET=utf8
16 1 row in set (0.00 sec)
17
18 ERROR:
19 No query specified
20
21
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
边栏推荐
- 用代码构建UI界面
- 深入理解IO流(第一篇)
- 华为设备配置BFD状态与接口状态联动
- Charles capture shows
solution - 模型训练前后显卡占用对比、多卡训练GPU占用分析【一文读懂】
- 在线开启gtid偶发hang住的问题解决
- 信息学奥赛一本通T1448:深搜的剪枝技巧 电路维修
- 阿里云-武林头条-建站小能手争霸赛
- 亿流量大考(1):日增上亿数据,把MySQL直接搞宕机了...
- El - tree set using setCheckedNodessetCheckedKeys default check nodes, and a new check through setChecked specified node
猜你喜欢
word之图表目录中点号位置提升3磅
10 分钟彻底理解 Redis 的持久化和主从复制
数据仓库指标体系实践
CDGA|如何加强数字政府建设?
用代码构建UI界面
华为设备配置BFD单跳检测二层链路
Umi 4 快速搭建项目
El - tree set using setCheckedNodessetCheckedKeys default check nodes, and a new check through setChecked specified node
【着色器实现HandDrawn简笔画抖动效果_Shader效果第十二篇】
【RT_Thread学习笔记】---以太网LAN8720A Lwip ping 通网络
随机推荐
Umi 4 快速搭建项目
线程基础(二)
被数据分析重塑的5个行业
华为设备BFD配置命令
重量级大咖来袭:阿里云生命科学与智能计算峰会精彩内容剧透
10 分钟彻底理解 Redis 的持久化和主从复制
Chrome configuration samesite=none method
QT信号与槽
uniapp 请求接口封装
postman将接口返回结果生成json文件到本地
MySQL忘记密码怎么办
Week5
el-table gets the data attribute of a row in the read data table
DIFM network, rounding and repetition
pyspark @udf 循环使用变量问题
static数据成员
保姆级讲解Transformer
我国有关信息方面的法律法规
模型训练前后显卡占用对比、多卡训练GPU占用分析【一文读懂】
《多线程案例》阻塞队列、定时器、线程池、饿汉与懒汉模式