INFORMATION_SCHEMA
INFORMATION_SCHEMA
INFORMATION_SCHEMA
USE
INSERT
UPDATE
DELETE
INFORMATION_SCHEMA
MySQL的> SELECT table_name, table_type, engine
FROM information_schema.tables
WHERE table_schema = 'db5'
ORDER BY table_name;
------------ ------------ -------- | table_name | table_type |发动机| ------------ ------------ -------- | FK |基表| InnoDB | | FK2 |基表| InnoDB | |转到|基表| MyISAM | |为|基表| MyISAM | | K |基表| MyISAM | |九|基表| MyISAM | |环|基表| MyISAM | | PK |基表| InnoDB | | T |基表| MyISAM | | T2 |基表| MyISAM | | T3 |基表| MyISAM | | T7 |基表| MyISAM表的基表| | | | MyISAM | | V |观|空| | V2 |观|空| | V3 |观|空| | V |观|空| ------------ ------------ -------- 17行集(0.01秒)
db5
TABLES.TABLE_NAME
N
N
INFORMATION_SCHEMA
SELECT ... FROM INFORMATION_SCHEMA
SHOW
SHOW DATABASES
SHOW TABLES
SELECT
SHOW
SELECT
INFORMATION_SCHEMA
SHOW
SHOW
SHOW
ROUTINE_DEFINITION
INFORMATION_SCHEMA.ROUTINES
InnoDB
PROCESS
INFORMATION_SCHEMA
SHOW
INFORMATION_SCHEMA
EXPLAIN
EXPLAIN
INFORMATION_SCHEMA
ENGINE
INFORMATION_SCHEMA.TABLES
syscat
INFORMATION_SCHEMA
COLLATION
TABLES
INFORMATION_SCHEMA
SHOW
SELECT
SHOW
db_name
AND TABLE_SCHEMA = SCHEMA()
WHERE
INFORMATION_SCHEMA
INFORMATION_SCHEMA
InnoDB
INFORMATION_SCHEMA
INFORMATION_SCHEMA
INFORMATION_SCHEMA
CHARACTER_SETS
INFORMATION_SCHEMA | SHOW | |
---|---|---|
CHARACTER_SET_NAME | Charset | |
DEFAULT_COLLATE_NAME | Default collation | |
DESCRIPTION | Description | |
MAXLEN | Maxlen |
CHARACTER_SETS
CHARACTER_SET_NAME
DEFAULT_COLLATE_NAME
DESCRIPTION
MAXLEN
SHOW CHARACTER SET
SELECT * FROM INFORMATION_SCHEMA.CHARACTER_SETS [WHERE CHARACTER_SET_NAME LIKE 'wild
'] SHOW CHARACTER SET [LIKE 'wild
']
COLLATIONS
INFORMATION_SCHEMA | SHOW | |
---|---|---|
COLLATION_NAME | Collation | |
CHARACTER_SET_NAME | Charset | |
ID | Id | |
IS_DEFAULT | Default | |
IS_COMPILED | Compiled | |
SORTLEN | Sortlen | |
PAD_ATTRIBUTE |
COLLATIONS
COLLATION_NAME
CHARACTER_SET_NAME
ID
IS_DEFAULT
IS_COMPILED
SORTLEN
PAD_ATTRIBUTE
SHOW COLLATION
SELECT COLLATION_NAME FROM INFORMATION_SCHEMA.COLLATIONS [WHERE COLLATION_NAME LIKE 'wild
'] SHOW COLLATION [LIKE 'wild
']
COLLATION_CHARACTER_SET_APPLICABILITY
INFORMATION_SCHEMA | SHOW |
---|---|
COLLATION_NAME | Collation |
CHARACTER_SET_NAME | Charset |
COLLATION_CHARACTER_SET_APPLICABILITY
COLLATION_NAME
CHARACTER_SET_NAME
COLLATION_CHARACTER_SET_APPLICABILITY
SHOW COLLATION
COLUMNS
ST_GEOMETRY_COLUMNS
INFORMATION_SCHEMA | SHOW | |
---|---|---|
TABLE_CATALOG | def | |
TABLE_SCHEMA | ||
TABLE_NAME | ||
COLUMN_NAME | Field | |
ORDINAL_POSITION | ||
COLUMN_DEFAULT | Default | |
IS_NULLABLE | Null | |
DATA_TYPE | Type | |
CHARACTER_MAXIMUM_LENGTH | Type | |
CHARACTER_OCTET_LENGTH | ||
NUMERIC_PRECISION | Type | |
NUMERIC_SCALE | Type | |
DATETIME_PRECISION | Type | |
CHARACTER_SET_NAME | ||
COLLATION_NAME | Collation | |
COLUMN_TYPE | Type | |
COLUMN_KEY | Key | |
EXTRA | Extra | |
PRIVILEGES | Privileges | |
COLUMN_COMMENT | Comment | |
GENERATION_EXPRESSION | ||
SRS_ID |
COLUMNS
TABLE_CATALOG
def
TABLE_SCHEMA
TABLE_NAME
COLUMN_NAME
ORDINAL_POSITION
ORDINAL_POSITION
SHOW
COLUMNS
SELECT
COLUMNS
COLUMN_DEFAULT
NULL
DEFAULT
IS_NULLABLE
YES
NO
DATA_TYPE
CHARACTER_MAXIMUM_LENGTH
CHARACTER_OCTET_LENGTH
NUMERIC_PRECISION
NUMERIC_SCALE
DATETIME_PRECISION
CHARACTER_SET_NAME
COLLATION_NAME
COLUMN_TYPE
COLUMN_KEY
COLUMN_KEY
COLUMN_KEY
PRIMARY
KEY
COLUMN_KEY
UNIQUE
NULL
Null
COLUMN_KEY
COLUMN_KEY
PRI
MUL
UNIQUE
NULL
UNIQUE
UNIQUE
EXTRA
PRIVILEGES
COLUMN_COMMENT
GENERATION_EXPRESSION
SRS_ID
SRID
NULL
SHOW COLUMNS
COLUMNS
CHARACTER_OCTET_LENGTH
CHARACTER_SET_NAME
SHOW FULL COLUMNS FROM t
utf8_swedish_ci
SHOW COLUMNS
SELECT COLUMN_NAME, DATA_TYPE, IS_NULLABLE, COLUMN_DEFAULT FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = 'tbl_name
' [AND table_schema = 'db_name
'] [AND column_name LIKE 'wild
'] SHOW COLUMNS FROMtbl_name
[FROMdb_name
] [LIKE 'wild
']
COLUMN_PRIVILEGES
COLUMN_PRIVILEGES
GRANTEE
'
user_name
'@'host_name
'
TABLE_CATALOG
def
TABLE_SCHEMA
TABLE_NAME
COLUMN_NAME
PRIVILEGE_TYPE
SELECT
INSERT
UPDATE
REFERENCES
SHOW FULL
COLUMNS
COLUMN_PRIVILEGES
IS_GRANTABLE
YES
GRANT OPTION
GRANT OPTION
SELECT ... FROM INFORMATION_SCHEMA.COLUMN_PRIVILEGES SHOW GRANTS ...
COLUMN_STATISTICS
COLUMN_STATISTICS
SCHEMA_NAME
TABLE_NAME
COLUMN_NAME
HISTOGRAM
JSON
ENGINES
INFORMATION_SCHEMA | SHOW | |
---|---|---|
ENGINE | Engine | |
SUPPORT | Support | |
COMMENT | Comment | |
TRANSACTIONS | Transactions | |
XA | XA | |
SAVEPOINTS | Savepoints |
ENGINES
ENGINE
SUPPORT
YES | |
DEFAULT | YES |
NO | |
DISABLED |
NO
DISABLED
DISABLED
engine_name
MyISAM
COMMENT
TRANSACTIONS
XA
SAVEPOINTS
ENGINES
SHOW ENGINES
SELECT * FROM INFORMATION_SCHEMA.ENGINES SHOW ENGINES
EVENTS
SHOW
Name
SHOW EVENTS
INFORMATION_SCHEMA | SHOW | |
---|---|---|
EVENT_CATALOG | def | |
EVENT_SCHEMA | Db | |
EVENT_NAME | Name | |
DEFINER | Definer | |
TIME_ZONE | Time zone | |
EVENT_BODY | ||
EVENT_DEFINITION | ||
EVENT_TYPE | Type | |
EXECUTE_AT | Execute at | |
INTERVAL_VALUE | Interval value | |
INTERVAL_FIELD | Interval field | |
SQL_MODE | ||
STARTS | Starts | |
ENDS | Ends | |
STATUS | Status | |
ON_COMPLETION | ||
CREATED | ||
LAST_ALTERED | ||
LAST_EXECUTED | ||
EVENT_COMMENT | ||
ORIGINATOR | Originator | |
CHARACTER_SET_CLIENT | character_set_client | |
COLLATION_CONNECTION | collation_connection | |
DATABASE_COLLATION | Database Collation |
EVENTS
EVENT_CATALOG
EVENT_SCHEMA
EVENT_NAME
DEFINER
user_name
host_name
TIME_ZONE
EVENT_BODY
DO
EVENT_DEFINITION
EVENT_DEFINITION
DO
EVENT_TYPE
RECURRING
EXECUTE_AT
DATETIME
CREATE EVENT
ALTER
EVENT
AT
'2006-02-10 20:05:30'
EVERY
NULL
INTERVAL_VALUE
AT
INTERVAL_FIELD
YEAR
DAY
AT
SQL_MODE
STARTS
DATETIME
STARTS
ENDS
DATETIME
ENDS
STATUS
DISABLED
SLAVESIDE_DISABLED
ON_COMPLETION
NOT
PRESERVE
CREATED
TIMESTAMP
LAST_ALTERED
TIMESTAMP
LAST_EXECUTED
DATETIME
LAST_EXECUTED
LAST_EXECUTED
EVENT_COMMENT
ORIGINATOR
CHARACTER_SET_CLIENT
character_set_client
COLLATION_CONNECTION
collation_connection
DATABASE_COLLATION
jon@ghidora
ALTER EVENT
分隔符|创建事件e_daily进度每1天的评论保存会话总数然后清除表每一天的开始插入site_activity.totals(时间、总)选择current_timestamp,计数(*)从site_activity.sessions;删除site_activity.sessions;端|定界符;改变事件e_daily使;
SELECT
MySQL的> SELECT * FROM INFORMATION_SCHEMA.EVENTS
> WHERE EVENT_NAME = 'e_daily'
> AND EVENT_SCHEMA = 'myschema'\G
*************************** 1。行*************************** event_catalog:def event_schema:测试event_name:e_daily定义:我@本地time_zone:系统event_body:SQL event_definition:开始插入site_activity.totals(时间、总)选择current_timestamp,计数(*)从site_activity.sessions;删除site_activity.sessions;端event_type:经常性execute_at:空interval_value:1 interval_field:天sql_mode:开始:2008-09-03 12:13:39结束:零状态:启用on_completion:不保存创建:2008-09-03 12:13:39 last_altered:2008-09-03 12:13:39 last_executed:空event_comment:保存的会话总数然后清除表每天鼻祖:1character_set_client:utf8collation_connection:utf8_swedish_ci database_collation:utf8_swedish_ci
EVENTS
FILES
INFORMATION_SCHEMA.FILES
NDB
INFORMATION_SCHEMA | SHOW | |
---|---|---|
FILE_ID | ||
FILE_NAME | ||
FILE_TYPE | ||
TABLESPACE_NAME | ||
TABLE_CATALOG | ||
TABLE_SCHEMA | ||
TABLE_NAME | ||
LOGFILE_GROUP_NAME | ||
LOGFILE_GROUP_NUMBER | ||
ENGINE | ||
FULLTEXT_KEYS | ||
DELETED_ROWS | ||
UPDATE_COUNT | ||
FREE_EXTENTS | ||
TOTAL_EXTENTS | ||
EXTENT_SIZE | ||
INITIAL_SIZE | ||
MAXIMUM_SIZE | ||
AUTOEXTEND_SIZE | ||
CREATION_TIME | ||
LAST_UPDATE_TIME | ||
LAST_ACCESS_TIME | ||
RECOVER_TIME | ||
TRANSACTION_COUNTER | ||
VERSION | ||
ROW_FORMAT | ||
TABLE_ROWS | ||
AVG_ROW_LENGTH | ||
DATA_LENGTH | ||
MAX_DATA_LENGTH | ||
INDEX_LENGTH | ||
DATA_FREE | ||
CREATE_TIME | ||
UPDATE_TIME | ||
CHECK_TIME | ||
CHECKSUM | ||
STATUS | ||
EXTRA |
InnoDB
INFORMATION_SCHEMA.FILES
NULL
INFORMATION_SCHEMA.FILES
INFORMATION_SCHEMA.INNODB_DATAFILES
SYS_DATAFILES
INFORMATION_SCHEMA.FILES
INNODB_DATAFILES
INFORMATION_SCHEMA.FILES
FILE_ID
fil_space_t::id
FILE_NAME
undo
ibtmp
datadir
FILE_TYPE
TABLESPACE
UNDO LOG
TABLESPACE_NAME
innodb_
innodb_undo
innodb_file_per_table_
##
##
ENGINE
InnoDB
FREE_EXTENTS
TOTAL_EXTENTS
EXTENT_SIZE
INFORMATION_SCHEMA.FILES
innodb_page_size
INNODB_TABLESPACES
FILES.FILE_ID = INNODB_TABLESPACES.SPACE_ID
INITIAL_SIZE
MAXIMUM_SIZE
innodb_data_file_path
innodb_temp_data_file_path
AUTOEXTEND_SIZE
innodb_data_file_path
innodb_temp_data_file_path
DATA_FREE
STATUS
InnoDB
InnoDB
MySQL >选择file_id,file_name,file_type,tablespace_name,free_extents,total_extents,extent_size,initial_size,maximum_size,autoextend_size,data_free,状态引擎information_schema.files \ G
KEY_COLUMN_USAGE
KEY_COLUMN_USAGE
CONSTRAINT_CATALOG
def
CONSTRAINT_SCHEMA
CONSTRAINT_NAME
TABLE_CATALOG
def
TABLE_SCHEMA
TABLE_NAME
COLUMN_NAME
ORDINAL_POSITION
POSITION_IN_UNIQUE_CONSTRAINT
NULL
REFERENCED_TABLE_SCHEMA
REFERENCED_TABLE_NAME
REFERENCED_COLUMN_NAME
t1
CREATE TABLE t1 ( s1 INT, s2 INT, s3 INT, PRIMARY KEY(s3) ) ENGINE=InnoDB; CREATE TABLE t3 ( s1 INT, s2 INT, s3 INT, KEY(s1), CONSTRAINT CO FOREIGN KEY (s2) REFERENCES t1(s3) ) ENGINE=InnoDB;
KEY_COLUMN_USAGE
CONSTRAINT_NAME
=TABLE_NAME
=COLUMN_NAME
=ORDINAL_POSITION
=POSITION_IN_UNIQUE_CONSTRAINT
=
CONSTRAINT_NAME
=TABLE_NAME
=COLUMN_NAME
=ORDINAL_POSITION
=POSITION_IN_UNIQUE_CONSTRAINT
=
KEYWORDS
KEYWORDS
KEYWORDS
WORD
RESERVED
SELECT * FROM INFORMATION_SCHEMA.KEYWORDS; SELECT WORD FROM INFORMATION_SCHEMA.KEYWORDS WHERE RESERVED = 1; SELECT WORD FROM INFORMATION_SCHEMA.KEYWORDS WHERE RESERVED = 0;
SELECT WORD FROM INFORMATION_SCHEMA.KEYWORDS WHERE RESERVED; SELECT WORD FROM INFORMATION_SCHEMA.KEYWORDS WHERE NOT RESERVED;
keyword_list.h
OPTIMIZER_TRACE
optimizer_trace
PARAMETERS
INFORMATION_SCHEMA | |
---|---|
SPECIFIC_CATALOG | def |
SPECIFIC_SCHEMA | |
SPECIFIC_NAME | |
ORDINAL_POSITION | RETURNS |
PARAMETER_MODE | IN
INOUT
RETURNS |
PARAMETER_NAME | NULL
|
DATA_TYPE | COLUMNS |
CHARACTER_MAXIMUM_LENGTH | COLUMNS |
CHARACTER_OCTET_LENGTH | COLUMNS |
NUMERIC_PRECISION | COLUMNS |
NUMERIC_SCALE | COLUMNS |
DATETIME_PRECISION | COLUMNS |
CHARACTER_SET_NAME | COLUMNS |
COLLATION_NAME | COLUMNS |
DTD_IDENTIFIER | COLUMNS |
ROUTINE_TYPE | ROUTINES |
ORDINAL_POSITION
ORDINAL_POSITION
PARAMETER_NAME
NULL
PARTITIONS
INFORMATION_SCHEMA | SHOW | |
---|---|---|
TABLE_CATALOG | ||
TABLE_SCHEMA | ||
TABLE_NAME | ||
PARTITION_NAME | ||
SUBPARTITION_NAME | ||
PARTITION_ORDINAL_POSITION | ||
SUBPARTITION_ORDINAL_POSITION | ||
PARTITION_METHOD | ||
SUBPARTITION_METHOD | ||
PARTITION_EXPRESSION | ||
SUBPARTITION_EXPRESSION | ||
PARTITION_DESCRIPTION | ||
TABLE_ROWS | ||
AVG_ROW_LENGTH | ||
DATA_LENGTH | ||
MAX_DATA_LENGTH | ||
INDEX_LENGTH | ||
DATA_FREE | ||
CREATE_TIME | ||
UPDATE_TIME | ||
CHECK_TIME | ||
CHECKSUM | ||
PARTITION_COMMENT | ||
NODEGROUP | ||
TABLESPACE_NAME |
PARTITIONS
TABLE_CATALOG
TABLE_SCHEMA
TABLE_NAME
PARTITION_NAME
SUBPARTITION_NAME
PARTITIONS
PARTITION_ORDINAL_POSITION
SUBPARTITION_ORDINAL_POSITION
PARTITION_METHOD
LIST
LINEAR HASH
LINEAR KEY
SUBPARTITION_METHOD
LINEAR HASH
LINEAR KEY
PARTITION_EXPRESSION
CREATE TABLE
ALTER TABLE
test
创建表的TP(C1 C2 C3 int,int,varchar(25))散列分区法(C1、C2)分区4;
PARTITION_EXPRESSION
mysql>SELECT DISTINCT PARTITION_EXPRESSION
>FROM INFORMATION_SCHEMA.PARTITIONS
>WHERE TABLE_NAME='tp' AND TABLE_SCHEMA='test';
+----------------------+ | PARTITION_EXPRESSION | +----------------------+ | c1 + c2 | +----------------------+ 1 row in set (0.09 sec)
SUBPARTITION_EXPRESSION
NULL
PARTITION_DESCRIPTION
VALUES LESS THAN
LIST
PARTITION_METHOD
LIST
TABLE_ROWS
InnoDB
AVG_ROW_LENGTH
DATA_LENGTH
DATA_LENGTH
MAX_DATA_LENGTH
INDEX_LENGTH
DATA_FREE
CREATE_TIME
UPDATE_TIME
CHECK_TIME
InnoDB
CHECKSUM
PARTITION_COMMENT
PARTITION_COMMENT
NODEGROUP
TABLESPACE_NAME
INFORMATION_SCHEMA.PARTITIONS
SUBPARTITION_NAME
SUBPARTITION_ORDINAL_POSITION
SUBPARTITION_METHOD
SUBPARTITION_EXPRESSION
NULL
PLUGINS
INFORMATION_SCHEMA | SHOW | |
---|---|---|
PLUGIN_NAME | Name | |
PLUGIN_VERSION | ||
PLUGIN_STATUS | Status | |
PLUGIN_TYPE | Type | |
PLUGIN_TYPE_VERSION | ||
PLUGIN_LIBRARY | Library | |
PLUGIN_LIBRARY_VERSION | ||
PLUGIN_AUTHOR | ||
PLUGIN_DESCRIPTION | ||
PLUGIN_LICENSE | License | |
LOAD_OPTION |
PLUGINS
PLUGIN_NAME
INSTALL
PLUGIN
UNINSTALL
PLUGIN
PLUGIN_VERSION
PLUGIN_STATUS
INACTIVE
DELETING
PLUGIN_TYPE
INFORMATION_SCHEMA
PLUGIN_TYPE_VERSION
PLUGIN_LIBRARY
INSTALL
PLUGIN
UNINSTALL
PLUGIN
plugin_dir
UNINSTALL PLUGIN
PLUGIN_LIBRARY_VERSION
PLUGIN_AUTHOR
PLUGIN_DESCRIPTION
PLUGIN_LICENSE
LOAD_OPTION
ON
FORCE_PLUS_PERMANENT
INSTALL
PLUGIN
PLUGIN_LIBRARY
SELECT PLUGIN_NAME, PLUGIN_STATUS, PLUGIN_TYPE, PLUGIN_LIBRARY, PLUGIN_LICENSE FROM INFORMATION_SCHEMA.PLUGINS; SHOW PLUGINS;
PLUGINS
SHOW PLUGINS
PROCESSLIST
INFORMATION_SCHEMA | SHOW | |
---|---|---|
ID | Id | |
USER | User | |
HOST | Host | |
DB | db | |
COMMAND | Command | |
TIME | Time | |
STATE | State | |
INFO | Info |
PROCESSLIST
SHOW
PROCESSLIST
PROCESS
INFORMATION_SCHEMA.PROCESSLIST
performance_schema.threads
threads
INFORMATION_SCHEMA.PROCESSLIST
SHOW PROCESSLIST
threads
INFORMATION_SCHEMA.PROCESSLIST
SHOW PROCESSLIST
threads
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST SHOW FULL PROCESSLIST
PROFILING
SHOW
PROFILES
SHOW PROFILE
profiling
INFORMATION_SCHEMA | SHOW |
---|---|
QUERY_ID | Query_ID |
SEQ |
|
STATE | Status |
DURATION | Duration |
CPU_USER | CPU_user |
CPU_SYSTEM | CPU_system |
CONTEXT_VOLUNTARY | Context_voluntary |
CONTEXT_INVOLUNTARY | Context_involuntary |
BLOCK_OPS_IN | Block_ops_in |
BLOCK_OPS_OUT | Block_ops_out |
MESSAGES_SENT | Messages_sent |
MESSAGES_RECEIVED | Messages_received |
PAGE_FAULTS_MAJOR | Page_faults_major |
PAGE_FAULTS_MINOR | Page_faults_minor |
SWAPS | Swaps |
SOURCE_FUNCTION | Source_function |
SOURCE_FILE | Source_file |
SOURCE_LINE | Source_line |
QUERY_ID
SEQ
STATE
DURATION
CPU_USER
CONTEXT_VOLUNTARY
BLOCK_OPS_IN
MESSAGES_SENT
PAGE_FAULTS_MAJOR
SWAPS
SOURCE_FUNCTION
SOURCE_LINE
REFERENTIAL_CONSTRAINTS
INFORMATION_SCHEMA | SHOW | |
---|---|---|
TABLE_NAME
INFORMATION_SCHEMA.TABLE_CONSTRAINTS
CONSTRAINT_SCHEMA
UNIQUE_CONSTRAINT_SCHEMA
REFERENCED_TABLE_NAME
MATCH_OPTION
UPDATE_RULE
CASCADE
SET DEFAULT
NO ACTION
RESOURCE_GROUPS
RESOURCE_GROUPS
RESOURCE_GROUP_NAME
RESOURCE_GROUP_TYPE
SYSTEM
RESOURCE_GROUP_ENABLED
VCPU_IDS
THREAD_PRIORITY
ROUTINES
ROUTINES
INFORMATION_SCHEMA | |
---|---|
SPECIFIC_NAME | |
ROUTINE_CATALOG | def |
ROUTINE_SCHEMA | |
ROUTINE_NAME | |
ROUTINE_TYPE | {PROCEDURE|FUNCTION} |
DATA_TYPE | COLUMNS |
CHARACTER_MAXIMUM_LENGTH | COLUMNS |
CHARACTER_OCTET_LENGTH | COLUMNS |
NUMERIC_PRECISION | COLUMNS |
NUMERIC_SCALE | COLUMNS |
DATETIME_PRECISION | COLUMNS |
CHARACTER_SET_NAME | COLUMNS |
COLLATION_NAME | COLUMNS |
DTD_IDENTIFIER | |
ROUTINE_BODY | SQL |
ROUTINE_DEFINITION | |
EXTERNAL_NAME | NULL |
EXTERNAL_LANGUAGE | |
PARAMETER_STYLE | SQL |
IS_DETERMINISTIC | |
SQL_DATA_ACCESS | |
SQL_PATH | NULL |
SECURITY_TYPE | |
CREATED | |
LAST_ALTERED | |
SQL_MODE | |
ROUTINE_COMMENT | |
DEFINER | |
CHARACTER_SET_CLIENT | |
COLLATION_CONNECTION | |
DATABASE_COLLATION |
EXTERNAL_LANGUAGE
mysql.routines
CREATED
TIMESTAMP
LAST_ALTERED
TIMESTAMP
SQL_MODE
CHARACTER_SET_CLIENT
character_set_client
COLLATION_CONNECTION
collation_connection
DATABASE_COLLATION
DATA_TYPE
CHARACTER_OCTET_LENGTH
NUMERIC_SCALE
CHARACTER_SET_NAME
RETURNS
RETURNS
PARAMETERS
SCHEMATA
INFORMATION_SCHEMA | SHOW | |
---|---|---|
CATALOG_NAME | def | |
SCHEMA_NAME | ||
DEFAULT_CHARACTER_SET_NAME | ||
DEFAULT_COLLATION_NAME | ||
SQL_PATH | NULL |
SELECT SCHEMA_NAME AS `Database` FROM INFORMATION_SCHEMA.SCHEMATA [WHERE SCHEMA_NAME LIKE 'wild
'] SHOW DATABASES [LIKE 'wild
']
SCHEMA_PRIVILEGES
SCHEMA_PRIVILEGES
GRANTEE
'
user_name
'@'host_name
'
TABLE_CATALOG
def
TABLE_SCHEMA
PRIVILEGE_TYPE
IS_GRANTABLE
YES
GRANT OPTION
GRANT OPTION
SCHEMA_PRIVILEGES
mysql.db
SELECT ... FROM INFORMATION_SCHEMA.SCHEMA_PRIVILEGES SHOW GRANTS ...
STATISTICS
STATISTICS
information_schema_stats_expiry
ANALYZE TABLE
information_schema_stats_expiry
innodb_read_only
ANALYZE
TABLE
ANALYZE
TABLE
information_schema_stats_expiry=0
INFORMATION_SCHEMA | SHOW | |
---|---|---|
TABLE_CATALOG | def | |
TABLE_SCHEMA | ||
TABLE_NAME | Table | |
NON_UNIQUE | Non_unique | |
INDEX_SCHEMA | ||
INDEX_NAME | Key_name | |
SEQ_IN_INDEX | Seq_in_index | |
COLUMN_NAME | Column_name | |
COLLATION | Collation | |
CARDINALITY | Cardinality | |
SUB_PART | Sub_part | |
PACKED | Packed | |
NULLABLE | Null | |
INDEX_TYPE | Index_type | |
COMMENT | Comment | |
INDEX_COMMENT | Index_comment | |
IS_VISIBLE | Visible | |
EXPRESSION | Expression |
STATISTICS
TABLE_CATALOG
def
TABLE_SCHEMA
TABLE_NAME
NON_UNIQUE
INDEX_SCHEMA
INDEX_NAME
PRIMARY
SEQ_IN_INDEX
COLUMN_NAME
EXPRESSION
COLLATION
A
NULL
CARDINALITY
ANALYZE
TABLE
CARDINALITY
SUB_PART
NULL
CREATE
TABLE
ALTER TABLE
CREATE INDEX
CHAR
VARCHAR
TEXT
BINARY
VARBINARY
BLOB
PACKED
NULL
NULLABLE
YES
''
INDEX_TYPE
BTREE
HASH
COMMENT
disabled
INDEX_COMMENT
COMMENT
IS_VISIBLE
EXPRESSION
COLUMN_NAME
COLUMN_NAME
NULL
COLUMN_NAME
EXPRESSION
INFORMATION_SCHEMA
QUALIFIER
CATALOG
SHOW INDEX
SELECT * FROM INFORMATION_SCHEMA.STATISTICS WHERE table_name = 'tbl_name
' AND table_schema = 'db_name
' SHOW INDEX FROMtbl_name
FROMdb_name
ST_GEOMETRY_COLUMNS
ST_GEOMETRY_COLUMNS
COLUMNS
ST_GEOMETRY_COLUMNS
TABLE_CATALOG
def
TABLE_SCHEMA
TABLE_NAME
COLUMN_NAME
SRS_NAME
SRS_ID
GEOMETRY_TYPE_NAME
geometry
linestring
multipoint
multipolygon
ST_SPATIAL_REFERENCE_SYSTEMS
ST_SPATIAL_REFERENCE_SYSTEMS
ST_SPATIAL_REFERENCE_SYSTEMS
SRS_NAME
SRS_ID
SRS_ID
ORGANIZATION
ORGANIZATION_COORDSYS_ID
DEFINITION
DEFINITION
DESCRIPTION
SRS_NAME
ORGANIZATION_COORDSYS_ID
mysql>SELECT * FROM ST_SPATIAL_REFERENCE_SYSTEMS
WHERE SRS_ID = 4326\G
*************************** 1. row *************************** SRS_NAME: WGS 84 SRS_ID: 4326 ORGANIZATION: EPSG ORGANIZATION_COORDSYS_ID: 4326 DEFINITION: GEOGCS["WGS 84",DATUM["World Geodetic System 1984", SPHEROID["WGS 84",6378137,298.257223563, AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]], PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]], UNIT["degree",0.017453292519943278, AUTHORITY["EPSG","9122"]], AXIS["Lat",NORTH],AXIS["Long",EAST], AUTHORITY["EPSG","4326"]] DESCRIPTION:
SRS_NAME
DEFINITION
GEOGCS
ST_SPATIAL_REFERENCE_SYSTEMS
mysql>SELECT
COUNT(*),
CASE LEFT(DEFINITION, 6)
WHEN 'PROJCS' THEN 'Projected'
WHEN 'GEOGCS' THEN 'Geographic'
ELSE 'Other'
END AS SRS_TYPE
FROM ST_SPATIAL_REFERENCE_SYSTEMS
GROUP BY SRS_TYPE;
+----------+------------+ | COUNT(*) | SRS_TYPE | +----------+------------+ | 1 | Other | | 4668 | Projected | | 483 | Geographic | +----------+------------+
CREATE SPATIAL REFERENCE
SYSTEM
TABLES
TABLES
information_schema_stats_expiry
ANALYZE TABLE
information_schema_stats_expiry
innodb_read_only
ANALYZE
TABLE
ANALYZE
TABLE
information_schema_stats_expiry=0
INFORMATION_SCHEMA | SHOW | |
---|---|---|
TABLE_CATALOG | def | |
TABLE_SCHEMA | Table_ | |
TABLE_NAME | Table_ | |
TABLE_TYPE | ||
ENGINE | Engine | |
VERSION | Version | .frm
10
|
ROW_FORMAT | Row_format | |
TABLE_ROWS | Rows | |
AVG_ROW_LENGTH | Avg_row_length | |
DATA_LENGTH | Data_length | |
MAX_DATA_LENGTH | Max_data_length | |
INDEX_LENGTH | Index_length | |
DATA_FREE | Data_free | |
AUTO_INCREMENT | Auto_increment | |
CREATE_TIME | Create_time | |
UPDATE_TIME | Update_time | |
CHECK_TIME | Check_time | |
TABLE_COLLATION | Collation | |
CHECKSUM | Checksum | |
CREATE_OPTIONS | Create_options | |
TABLE_COMMENT | Comment |
SHOW TABLE
STATUS
TABLE_SCHEMA
SHOW
TABLE_TYPE
VIEW
TABLES
ENGINE
TABLE_ROWS
INFORMATION_SCHEMA
DATA_FREE
UPDATE_TIME
UPDATE
INSERT
DELETE
COMMIT
InnoDB
NULL
TABLE_COLLATION
CREATE_OPTIONS
ENCRYPTION
INNODB_TABLESPACES
SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = 'db_name
' [AND table_name LIKE 'wild
'] SHOW TABLES FROMdb_name
[LIKE 'wild
']
TABLESPACES
INFORMATION_SCHEMA | SHOW | |
---|---|---|
TABLESPACE_NAME | ||
ENGINE | ||
TABLESPACE_TYPE | ||
LOGFILE_GROUP_NAME | ||
EXTENT_SIZE | ||
AUTOEXTEND_SIZE | ||
MAXIMUM_SIZE | ||
NODEGROUP_ID | ||
TABLESPACE_COMMENT |
INFORMATION_SCHEMA.TABLESPACES
InnoDB
INNODB_TABLESPACES
INNODB_DATAFILES
INFORMATION_SCHEMA.FILES
TABLE_CONSTRAINTS
TABLE_CONSTRAINTS
CONSTRAINT_CATALOG
def
CONSTRAINT_SCHEMA
TABLE_SCHEMA
TABLE_NAME
CONSTRAINT_TYPE
UNIQUE
FOREIGN KEY
CHAR
ENUM
CHECK
UNIQUE
Key_name
SHOW INDEX
0
TABLE_PRIVILEGES
TABLE_PRIVILEGES
GRANTEE
'
user_name
'@'host_name
'
TABLE_CATALOG
def
TABLE_SCHEMA
TABLE_NAME
PRIVILEGE_TYPE
SELECT
INSERT
UPDATE
REFERENCES
ALTER
INDEX
DROP
CREATE VIEW
IS_GRANTABLE
YES
GRANT OPTION
GRANT OPTION
SELECT ... FROM INFORMATION_SCHEMA.TABLE_PRIVILEGES SHOW GRANTS ...
TRIGGERS
TRIGGER
INFORMATION_SCHEMA | SHOW | |
---|---|---|
TRIGGER_CATALOG | def | |
TRIGGER_SCHEMA | ||
TRIGGER_NAME | Trigger | |
EVENT_MANIPULATION | Event | |
EVENT_OBJECT_CATALOG | def | |
EVENT_OBJECT_SCHEMA | ||
EVENT_OBJECT_TABLE | Table | |
ACTION_ORDER | ||
ACTION_CONDITION | NULL | |
ACTION_STATEMENT | Statement | |
ACTION_ORIENTATION | ROW | |
ACTION_TIMING | Timing | |
ACTION_REFERENCE_OLD_TABLE | NULL | |
ACTION_REFERENCE_NEW_TABLE | NULL | |
ACTION_REFERENCE_OLD_ROW | OLD | |
ACTION_REFERENCE_NEW_ROW | NEW | |
CREATED | Created | |
SQL_MODE | sql_mode | |
DEFINER | Definer | |
CHARACTER_SET_CLIENT | character_set_client | |
COLLATION_CONNECTION | collation_connection | |
DATABASE_COLLATION | Database Collation |
SHOW
SHOW
TRIGGERS
SHOW
CREATE TRIGGER
TRIGGER_SCHEMA
EVENT_MANIPULATION
'DELETE'
EVENT_OBJECT_SCHEMA
ACTION_ORDER
ACTION_TIMING
ACTION_STATEMENT
ACTION_ORIENTATION
ACTION_TIMING
'AFTER'
ACTION_REFERENCE_OLD_ROW
ACTION_REFERENCE_OLD_ROW
ACTION_REFERENCE_NEW_ROW
CREATED
SQL_MODE
DEFINER
user_name
host_name
CHARACTER_SET_CLIENT
character_set_client
COLLATION_CONNECTION
collation_connection
DATABASE_COLLATION
NULL
ACTION_REFERENCE_OLD_TABLE
ins_sum
mysql>SELECT * FROM INFORMATION_SCHEMA.TRIGGERS
WHERE TRIGGER_SCHEMA='test' AND TRIGGER_NAME='ins_sum'\G
*************************** 1. row *************************** TRIGGER_CATALOG: def TRIGGER_SCHEMA: test TRIGGER_NAME: ins_sum EVENT_MANIPULATION: INSERT EVENT_OBJECT_CATALOG: def EVENT_OBJECT_SCHEMA: test EVENT_OBJECT_TABLE: account ACTION_ORDER: 1 ACTION_CONDITION: NULL ACTION_STATEMENT: SET @sum = @sum + NEW.amount ACTION_ORIENTATION: ROW ACTION_TIMING: BEFORE ACTION_REFERENCE_OLD_TABLE: NULL ACTION_REFERENCE_NEW_TABLE: NULL ACTION_REFERENCE_OLD_ROW: OLD ACTION_REFERENCE_NEW_ROW: NEW CREATED: 2017-03-30 20:29:39.06 SQL_MODE: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION DEFINER: me@localhost CHARACTER_SET_CLIENT: utf8 COLLATION_CONNECTION: utf8_general_ci DATABASE_COLLATION: utf8mb4_0900_ai_ci
USER_PRIVILEGES
INFORMATION_SCHEMA | SHOW | |
---|---|---|
GRANTEE | ' | |
TABLE_CATALOG | def | |
PRIVILEGE_TYPE | ||
IS_GRANTABLE |
USER_PRIVILEGES
mysql.user
VIEWS
SHOW VIEW
INFORMATION_SCHEMA | SHOW | |
---|---|---|
TABLE_CATALOG | def | |
TABLE_SCHEMA | ||
TABLE_NAME | ||
VIEW_DEFINITION | ||
CHECK_OPTION | ||
IS_UPDATABLE | ||
DEFINER | ||
SECURITY_TYPE | ||
CHARACTER_SET_CLIENT | ||
COLLATION_CONNECTION |
VIEW_DEFINITION
SHOW CREATE VIEW
SELECT
CREATE VIEW v AS SELECT s2,s1 FROM t WHERE s1 > 5 ORDER BY s1 WITH CHECK OPTION;
SELECT s2,s1 FROM t WHERE s1 > 5 ORDER BY s1
CHECK_OPTION
CASCADE
CREATE VIEW
UPDATE
DELETE
IS_UPDATABLE
VIEWS
UPDATE
DELETE
INSERT
DEFINER
user_name
host_name
DEFINER
CHARACTER_SET_CLIENT
character_set_client
COLLATION_CONNECTION
collation_connection
sql_mode
ANSI
sql_mode
ANSI
CONCAT()
MySQL的> SET sql_mode = 'ANSI';
查询好,为受影响的行(0.001秒)MySQL > CREATE VIEW test.v AS SELECT 'a' || 'b' as col1;
查询好,为受影响的行(0.001秒)MySQL > SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS
WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME = 'v';
---------------------------------- | view_definition | ---------------------------------- |选择concat(A,B)为` col1 ` | ---------------------------------- 1行集(0秒)
sql_mode
SELECT
VIEW_ROUTINE_USAGE
VIEW_ROUTINE_USAGE
TABLE_CATALOG
TABLE_SCHEMA
TABLE_NAME
SPECIFIC_CATALOG
SPECIFIC_SCHEMA
SPECIFIC_NAME
VIEW_TABLE_USAGE
VIEW_TABLE_USAGE
VIEW_CATALOG
VIEW_SCHEMA
VIEW_NAME
TABLE_CATALOG
TABLE_SCHEMA
TABLE_NAME
InnoDB
InnoDB
InnoDB
INNODB_BUFFER_PAGE
InnoDB
INNODB_BUFFER_PAGE
POOL_ID | |
BLOCK_ID | |
SPACE | INNODB_TABLES.SPACE |
PAGE_NUMBER | |
PAGE_TYPE | ALLOCATED
UNDO_LOG
IBUF_FREE_LIST
SYSTEM
FILE_SPACE_HEADER
BLOB
COMPRESSED_BLOB2
RTREE_INDEX
SDI_BLOB
UNKNOWN
PAGE_IO_ENCRYPTED
ENCRYPTED_RTREE
RSEG_ARRAY
LOB_DATA
ZLOB_FIRST
ZLOB_INDEX
ZLOB_FRAG_ENTRY |
FLUSH_TYPE | |
FIX_COUNT | |
IS_HASHED | |
NEWEST_MODIFICATION | |
OLDEST_MODIFICATION | |
ACCESS_TIME | |
TABLE_NAME | INDEX |
INDEX_NAME | INDEX |
NUMBER_RECORDS | |
DATA_SIZE | INDEX |
COMPRESSED_SIZE | |
PAGE_STATE | NULL
READY_FOR_USE
MEMORY
|
IO_FIX | IO_NONE = no pending I/O, = read pending,IO_WRITE = write pending. |
IS_OLD | |
FREE_PAGE_CLOCK | freed_page_clock
|
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE LIMIT 1\G
*************************** 1. row ***************************
POOL_ID: 0
BLOCK_ID: 0
SPACE: 97
PAGE_NUMBER: 2473
PAGE_TYPE: INDEX
FLUSH_TYPE: 1
FIX_COUNT: 0
IS_HASHED: YES
NEWEST_MODIFICATION: 733855581
OLDEST_MODIFICATION: 0
ACCESS_TIME: 3378385672
TABLE_NAME: `employees`.`salaries`
INDEX_NAME: PRIMARY
NUMBER_RECORDS: 468
DATA_SIZE: 14976
COMPRESSED_SIZE: 0
PAGE_STATE: FILE_PAGE
IO_FIX: IO_NONE
IS_OLD: YES
FREE_PAGE_CLOCK: 66
DESCRIBE
SHOW COLUMNS
PROCESS
INNODB_BUFFER_PAGE
INNODB_BUFFER_PAGE_LRU
INNODB_BUFFER_PAGE_LRU
INNODB_BUFFER_PAGE
INNODB_BUFFER_PAGE_LRU
BLOCK_ID
INNODB_BUFFER_PAGE_LRU
POOL_ID | |
LRU_POSITION | |
SPACE | INNODB_TABLES.SPACE |
PAGE_NUMBER | |
PAGE_TYPE | ALLOCATED
UNDO_LOG
IBUF_FREE_LIST
SYSTEM
FILE_SPACE_HEADER
BLOB
COMPRESSED_BLOB2
RTREE_INDEX
SDI_BLOB
UNKNOWN
PAGE_IO_ENCRYPTED
ENCRYPTED_RTREE
RSEG_ARRAY
LOB_DATA
ZLOB_FIRST
ZLOB_INDEX
ZLOB_FRAG_ENTRY |
FLUSH_TYPE | |
FIX_COUNT | |
IS_HASHED | |
NEWEST_MODIFICATION | |
OLDEST_MODIFICATION | |
ACCESS_TIME | |
TABLE_NAME | INDEX |
INDEX_NAME | INDEX |
NUMBER_RECORDS | |
DATA_SIZE | INDEX |
COMPRESSED_SIZE | |
PAGE_STATE | NULL
READY_FOR_USE
MEMORY
|
IO_FIX | IO_NONE = no pending I/O, = read pending,IO_WRITE = write pending. |
IS_OLD | |
FREE_PAGE_CLOCK | freed_page_clock
|
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE_LRU LIMIT 1\G
*************************** 1. row ***************************
POOL_ID: 0
LRU_POSITION: 0
SPACE: 97
PAGE_NUMBER: 1984
PAGE_TYPE: INDEX
FLUSH_TYPE: 1
FIX_COUNT: 0
IS_HASHED: YES
NEWEST_MODIFICATION: 719490396
OLDEST_MODIFICATION: 0
ACCESS_TIME: 3378383796
TABLE_NAME: `employees`.`salaries`
INDEX_NAME: PRIMARY
NUMBER_RECORDS: 468
DATA_SIZE: 14976
COMPRESSED_SIZE: 0
COMPRESSED: NO
IO_FIX: IO_NONE
IS_OLD: YES
FREE_PAGE_CLOCK: 0
PROCESS
DESCRIBE
SHOW COLUMNS
INNODB_BUFFER_PAGE_LRU
INNODB_BUFFER_POOL_STATS
InnoDB
POOL_ID | |
POOL_SIZE | InnoDB |
FREE_BUFFERS | InnoDB |
DATABASE_PAGES | InnoDB |
OLD_DATABASE_PAGES | old |
MODIFIED_DATABASE_PAGES | |
PENDING_DECOMPRESS | |
PENDING_READS | |
PENDING_FLUSH_LRU | |
PENDING_FLUSH_LIST | |
PAGES_MADE_YOUNG | |
PAGES_NOT_MADE_YOUNG | |
PAGES_MADE_YOUNG_RATE | |
PAGES_MADE_NOT_YOUNG_RATE | |
NUMBER_PAGES_READ | |
NUMBER_PAGES_CREATED | |
NUMBER_PAGES_WRITTEN | |
PAGES_READ_RATE | |
PAGES_CREATE_RATE | |
PAGES_WRITTEN_RATE | |
NUMBER_PAGES_GET | |
HIT_RATE | |
YOUNG_MAKE_PER_THOUSAND_GETS | |
NOT_YOUNG_MAKE_PER_THOUSAND_GETS | |
NUMBER_PAGES_READ_AHEAD | |
NUMBER_READ_AHEAD_EVICTED | InnoDB |
READ_AHEAD_RATE | |
READ_AHEAD_EVICTED_RATE | |
LRU_IO_TOTAL | |
LRU_IO_CURRENT | |
UNCOMPRESS_TOTAL | |
UNCOMPRESS_CURRENT |
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_STATS\G
*************************** 1. row ***************************
POOL_ID: 0
POOL_SIZE: 8192
FREE_BUFFERS: 1
DATABASE_PAGES: 8085
OLD_DATABASE_PAGES: 2964
MODIFIED_DATABASE_PAGES: 0
PENDING_DECOMPRESS: 0
PENDING_READS: 0
PENDING_FLUSH_LRU: 0
PENDING_FLUSH_LIST: 0
PAGES_MADE_YOUNG: 22821
PAGES_NOT_MADE_YOUNG: 3544303
PAGES_MADE_YOUNG_RATE: 357.62602199870594
PAGES_MADE_NOT_YOUNG_RATE: 0
NUMBER_PAGES_READ: 2389
NUMBER_PAGES_CREATED: 12385
NUMBER_PAGES_WRITTEN: 13111
PAGES_READ_RATE: 0
PAGES_CREATE_RATE: 0
PAGES_WRITTEN_RATE: 0
NUMBER_PAGES_GET: 33322210
HIT_RATE: 1000
YOUNG_MAKE_PER_THOUSAND_GETS: 18
NOT_YOUNG_MAKE_PER_THOUSAND_GETS: 0
NUMBER_PAGES_READ_AHEAD: 2024
NUMBER_READ_AHEAD_EVICTED: 0
READ_AHEAD_RATE: 0
READ_AHEAD_EVICTED_RATE: 0
LRU_IO_TOTAL: 0
LRU_IO_CURRENT: 0
UNCOMPRESS_TOTAL: 0
UNCOMPRESS_CURRENT: 0
DESCRIBE
SHOW COLUMNS
PROCESS
INNODB_CACHED_INDEXES
SPACE_ID | |
INDEX_ID | |
N_CACHED_PAGES | InnoDB |
InnoDB
MySQL的> SELECT * FROM INFORMATION_SCHEMA.INNODB_CACHED_INDEXES WHERE INDEX_ID=65\G
*************************** 1。行*************************** index_id:65n_cached_pages:451列集(0.001秒)
InnoDB
INNODB_INDEXES
INNODB_TABLES
SELECT tables.name AS table_name, indexes.name AS index_name, cached.n_cached_pages AS n_cached_pages FROM INFORMATION_SCHEMA.INNODB_CACHED_INDEXES AS cached, INFORMATION_SCHEMA.INNODB_INDEXES AS indexes, INFORMATION_SCHEMA.INNODB_TABLES AS tables WHERE cached.index_id = indexes.index_id AND indexes.table_id = tables.table_id;
DESCRIBE
SHOW COLUMNS
PROCESS
INNODB_CMP
InnoDB
PAGE_SIZE | |
COMPRESS_OPS | PAGE_SIZE |
COMPRESS_OPS_OK | PAGE_SIZE
|
COMPRESS_TIME | PAGE_SIZE |
UNCOMPRESS_OPS | PAGE_SIZE |
UNCOMPRESS_TIME | PAGE_SIZE |
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_CMP\G
*************************** 1. row ***************************
page_size: 1024
compress_ops: 0
compress_ops_ok: 0
compress_time: 0
uncompress_ops: 0
uncompress_time: 0
*************************** 2. row ***************************
page_size: 2048
compress_ops: 0
compress_ops_ok: 0
compress_time: 0
uncompress_ops: 0
uncompress_time: 0
*************************** 3. row ***************************
page_size: 4096
compress_ops: 0
compress_ops_ok: 0
compress_time: 0
uncompress_ops: 0
uncompress_time: 0
*************************** 4. row ***************************
page_size: 8192
compress_ops: 86955
compress_ops_ok: 81182
compress_time: 27
uncompress_ops: 26828
uncompress_time: 5
*************************** 5. row ***************************
page_size: 16384
compress_ops: 0
compress_ops_ok: 0
compress_time: 0
uncompress_ops: 0
uncompress_time: 0
InnoDB
DESCRIBE
SHOW COLUMNS
PROCESS
InnoDB
INNODB_CMPMEM
InnoDB
PAGE_SIZE | |
BUFFER_POOL_INSTANCE | |
PAGES_USED | PAGE_SIZE |
PAGES_FREE | PAGE_SIZE |
RELOCATION_OPS | PAGE_SIZE INNODB_CMPMEM_RESET |
RELOCATION_TIME | PAGE_SIZE
|
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_CMPMEM\G
*************************** 1. row ***************************
page_size: 1024
buffer_pool_instance: 0
pages_used: 0
pages_free: 0
relocation_ops: 0
relocation_time: 0
*************************** 2. row ***************************
page_size: 2048
buffer_pool_instance: 0
pages_used: 0
pages_free: 0
relocation_ops: 0
relocation_time: 0
*************************** 3. row ***************************
page_size: 4096
buffer_pool_instance: 0
pages_used: 0
pages_free: 0
relocation_ops: 0
relocation_time: 0
*************************** 4. row ***************************
page_size: 8192
buffer_pool_instance: 0
pages_used: 7673
pages_free: 15
relocation_ops: 4638
relocation_time: 0
*************************** 5. row ***************************
page_size: 16384
buffer_pool_instance: 0
pages_used: 0
pages_free: 0
relocation_ops: 0
relocation_time: 0
InnoDB
DESCRIBE
SHOW COLUMNS
PROCESS
InnoDB
INNODB_CMP_PER_INDEX
InnoDB
InnoDB
DATABASE_NAME | |
TABLE_NAME | |
INDEX_NAME | |
COMPRESS_OPS | |
COMPRESS_OPS_OK | COMPRESS_OPS COMPRESS_OPS |
COMPRESS_TIME | |
UNCOMPRESS_OPS | InnoDB |
UNCOMPRESS_TIME |
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_CMP_PER_INDEX\G
*************************** 1. row ***************************
database_name: employees
table_name: salaries
index_name: PRIMARY
compress_ops: 0
compress_ops_ok: 0
compress_time: 0
uncompress_ops: 23451
uncompress_time: 4
*************************** 2. row ***************************
database_name: employees
table_name: salaries
index_name: emp_no
compress_ops: 0
compress_ops_ok: 0
compress_time: 0
uncompress_ops: 1597
uncompress_time: 0
InnoDB
DESCRIBE
SHOW COLUMNS
PROCESS
INNODB_CMP_PER_INDEX
innodb_cmp_per_index_enabled
InnoDB
INNODB_FT_BEING_DELETED
INNODB_FT_DELETED
OPTIMIZE
TABLE
OPTIMIZE TABLE
INNODB_FT_DELETED
OPTIMIZE TABLE
innodb_ft_aux_table
INNODB_FT_DELETED
DOC_ID | InnoDB innodb_ft_index_table
OPTIMIZE TABLE |
DESCRIBE
SHOW COLUMNS
PROCESS
InnoDB
INNODB_FT_CONFIG
InnoDB
innodb_ft_aux_table
test/articles
KEY | InnoDB
|
VALUE | KEY
InnoDB |
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_CONFIG;
+---------------------------+-------------------+
| KEY | VALUE |
+---------------------------+-------------------+
| optimize_checkpoint_limit | 180 |
| synced_doc_id | 0 |
| stopword_table_name | test/my_stopwords |
| use_stopword | 1 |
+---------------------------+-------------------+
DESCRIBE
SHOW COLUMNS
PROCESS
KEY
optimize_checkpoint_limit
OPTIMIZE
TABLE
synced_doc_id
stopword_table_name
database/table
use_stopword
InnoDB
INNODB_FT_DEFAULT_STOPWORD
FULLTEXT
InnoDB
value | FULLTEXT
innodb_ft_server_stopword_table innodb_ft_user_stopword_table |
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_DEFAULT_STOPWORD;
+-------+
| value |
+-------+
| a |
| about |
| an |
| are |
| as |
| at |
| be |
| by |
| com |
| de |
| en |
| for |
| from |
| how |
| i |
| in |
| is |
| it |
| la |
| of |
| on |
| or |
| that |
| the |
| this |
| to |
| was |
| what |
| when |
| where |
| who |
| will |
| with |
| und |
| the |
| www |
+-------+
36 rows in set (0.00 sec)
DESCRIBE
SHOW COLUMNS
PROCESS
InnoDB
INNODB_FT_DELETED
InnoDB
FULLTEXT
OPTIMIZE TABLE
innodb_ft_aux_table
test/articles
DOC_ID | InnoDB innodb_ft_index_table
OPTIMIZE TABLE |
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_DELETED;
+--------+
| DOC_ID |
+--------+
| 6 |
| 7 |
| 8 |
+--------+
DESCRIBE
SHOW COLUMNS
PROCESS
InnoDB
INNODB_FT_INDEX_CACHE
OPTIMIZE
TABLE
innodb_ft_cache_size
innodb_ft_total_cache_size
innodb_ft_aux_table
test/articles
WORD | |
FIRST_DOC_ID | FULLTEXT |
LAST_DOC_ID | FULLTEXT |
DOC_COUNT | FULLTEXT
POSITION |
DOC_ID | InnoDB |
POSITION | DOC_ID
|
innodb_ft_aux_table
innodb_ft_aux_table
mysql>USE test;
mysql>CREATE TABLE articles ( id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, title VARCHAR(200), body TEXT, FULLTEXT (title,body) ) ENGINE=InnoDB;
mysql>INSERT INTO articles (title,body) VALUES ('MySQL Tutorial','DBMS stands for DataBase ...'), ('How To Use MySQL Well','After you went through a ...'), ('Optimizing MySQL','In this tutorial we will show ...'), ('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'), ('MySQL vs. YourSQL','In the following database comparison ...'), ('MySQL Security','When configured properly, MySQL ...');
mysql>SET GLOBAL innodb_ft_aux_table = 'test/articles';
Query OK, 0 rows affected (0.00 sec) mysql>USE INFORMATION_SCHEMA;
mysql>SELECT word, doc_count, doc_id, position FROM INNODB_FT_INDEX_CACHE LIMIT 5;
+------------+-----------+--------+----------+ | word | doc_count | doc_id | position | +------------+-----------+--------+----------+ | 1001 | 1 | 4 | 0 | | after | 1 | 2 | 22 | | comparison | 1 | 5 | 44 | | configured | 1 | 6 | 20 | | database | 2 | 1 | 31 | +------------+-----------+--------+----------+
DESCRIBE
SHOW COLUMNS
PROCESS
InnoDB
INNODB_FT_INDEX_TABLE
InnoDB
innodb_ft_aux_table
test/articles
WORD | FULLTEXT |
FIRST_DOC_ID | FULLTEXT |
LAST_DOC_ID | FULLTEXT |
DOC_COUNT | FULLTEXT
POSITION |
DOC_ID | InnoDB |
POSITION | DOC_ID |
innodb_ft_aux_table
innodb_ft_aux_table
INNODB_FT_INDEX_TABLE
OPTIMIZE TABLE
innodb_optimize_fulltext_only=ON
MySQL的> USE test;
MySQL的> CREATE TABLE articles ( id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, title VARCHAR(200), body TEXT, FULLTEXT (title,body) ) ENGINE=InnoDB;
MySQL的> INSERT INTO articles (title,body) VALUES ('MySQL Tutorial','DBMS stands for DataBase ...'), ('How To Use MySQL Well','After you went through a ...'), ('Optimizing MySQL','In this tutorial we will show ...'), ('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'), ('MySQL vs. YourSQL','In the following database comparison ...'), ('MySQL Security','When configured properly, MySQL ...');
MySQL的> SET GLOBAL innodb_optimize_fulltext_only=ON;
查询好,为受影响的行(0.001秒)MySQL > OPTIMIZE TABLE articles;
--------------- ---------- ---------- ---------- |表| OP | msg_type | msg_text | --------------- ---------- ---------- ---------- | test.articles |优化|状态|好| --------------- ---------- ---------- ---------- MySQL > SET GLOBAL innodb_ft_aux_table = 'test/articles';
查询好,为受影响的行(0.001秒)MySQL > USE INFORMATION_SCHEMA;
MySQL的> SELECT word, doc_count, doc_id, position FROM INNODB_FT_INDEX_TABLE LIMIT 5;
------------ ----------- -------- ---------- |字| doc_count | doc_id |位置| ------------ ----------- -------- ---------- | 1001 | 1 | 4 | 0 | |后| 1 | 2 | 22 | |比较| 1 | 5 | 44 | |配置| 1 | 6 | 20 | |数据库| 2 | 1 | 31 | ------------ ----------- -------- ----------
DESCRIBE
SHOW COLUMNS
PROCESS
InnoDB
INNODB_LOCKS
data_locks
INNODB_LOCKS
data_locks
INNODB_LOCKS
data_locks
data_locks
LOCK_PAGE
INNODB_LOCKS
PROCESS
data_locks
SELECT
INNODB_LOCKS
data_locks
LOCK_ID | ENGINE_LOCK_ID |
LOCK_TRX_ID | ENGINE_TRANSACTION_ID |
LOCK_MODE | LOCK_MODE |
LOCK_TYPE | LOCK_TYPE |
LOCK_TABLE | OBJECT_SCHEMA
|
LOCK_INDEX | INDEX_NAME |
LOCK_SPACE | |
LOCK_PAGE | |
LOCK_REC | |
LOCK_DATA | LOCK_DATA |
INNODB_LOCK_WAITS
data_lock_waits
INNODB_LOCK_WAITS
PROCESS
data_lock_waits
SELECT
INNODB_LOCK_WAITS
data_lock_waits
REQUESTING_TRX_ID | REQUESTING_ENGINE_TRANSACTION_ID |
REQUESTED_LOCK_ID | REQUESTING_ENGINE_LOCK_ID |
BLOCKING_TRX_ID | BLOCKING_ENGINE_TRANSACTION_ID |
BLOCKING_LOCK_ID | BLOCKING_ENGINE_LOCK_ID |
INFORMATION_SCHEMA
PERFORMANCE_SCHEMA
InnoDB
innodb_monitor_enable
innodb_monitor_disable
innodb_monitor_reset
innodb_monitor_reset_all
all
NAME | |
SUBSYSTEM | InnoDB
|
COUNT | |
MAX_COUNT | |
MIN_COUNT | |
AVG_COUNT | |
COUNT_RESET | _RESET
MAX_COUNT |
MAX_COUNT_RESET | |
MIN_COUNT_RESET | |
AVG_COUNT_RESET | |
TIME_ENABLED | |
TIME_DISABLED | |
TIME_ELAPSED | |
TIME_RESET | |
STATUS | enabled
|
TYPE | |
COMMENT |
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME="dml_inserts"\G
*************************** 1. row ***************************
NAME: dml_inserts
SUBSYSTEM: dml
COUNT: 3
MAX_COUNT: 3
MIN_COUNT: NULL
AVG_COUNT: 0.046153846153846156
COUNT_RESET: 3
MAX_COUNT_RESET: 3
MIN_COUNT_RESET: NULL
AVG_COUNT_RESET: NULL
TIME_ENABLED: 2014-12-04 14:18:28
TIME_DISABLED: NULL
TIME_ELAPSED: 65
TIME_RESET: NULL
STATUS: enabled
TYPE: status_counter
COMMENT: Number of rows inserted
PROCESS
DESCRIBE
SHOW COLUMNS
INNODB_COLUMNS
TABLE_ID | INNODB_TABLES.TABLE_ID |
NAME | lower_case_table_names |
POS | POS
|
MTYPE | VARCHAR , 2 = , 3 =FIXBINARY , 4 = , 5 =BLOB , 6 = , 7 =SYS_CHILD , 8 = , 9 =FLOAT , 10 = , 11 =DECIMAL , 12 = , 13 =MYSQL , 14 =
|
PRTYPE | InnoDB |
LEN | INT
VARCHAR(
|
HAS_DEFAULT | ALTER
TABLE ... ADD COLUMN ALGORITHM=INSTANT |
DEFAULT_VALUE | ALTER TABLE ...
ADD COLUMN ALGORITHM=INSTANT NULL
NULL |
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_COLUMNS where TABLE_ID = 71\G
*************************** 1. row ***************************
TABLE_ID: 71
NAME: col1
POS: 0
MTYPE: 6
PRTYPE: 1027
LEN: 4
HAS_DEFAULT: 0
DEFAULT_VALUE: NULL
*************************** 2. row ***************************
TABLE_ID: 71
NAME: col2
POS: 1
MTYPE: 2
PRTYPE: 524542
LEN: 10
HAS_DEFAULT: 0
DEFAULT_VALUE: NULL
*************************** 3. row ***************************
TABLE_ID: 71
NAME: col3
POS: 2
MTYPE: 1
PRTYPE: 524303
LEN: 10
HAS_DEFAULT: 0
DEFAULT_VALUE: NULL
DESCRIBE
SHOW COLUMNS
PROCESS
INNODB_DATAFILES
INFORMATION_SCHEMA.FILES
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_DATAFILES WHERE SPACE = 57\G
*************************** 1. row ***************************
SPACE: 57
PATH: ./test/t1.ibd
DESCRIBE
SHOW COLUMNS
PROCESS
INNODB_FIELDS
INDEX_ID | INNODB_INDEXES.INDEX_ID |
NAME | INNODB_COLUMNS.NAME |
POS |
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_FIELDS WHERE INDEX_ID = 117\G
*************************** 1. row ***************************
INDEX_ID: 117
NAME: col1
POS: 0
DESCRIBE
SHOW COLUMNS
PROCESS
INNODB_FOREIGN
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_FOREIGN\G
*************************** 1. row ***************************
ID: test/fk1
FOR_NAME: test/child
REF_NAME: test/parent
N_COLS: 1
TYPE: 1
DESCRIBE
SHOW COLUMNS
PROCESS
INNODB_FOREIGN_COLS
ID | INNODB_FOREIGN.ID |
FOR_COL_NAME | |
REF_COL_NAME | |
POS |
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_FOREIGN_COLS WHERE ID = 'test/fk1'\G
*************************** 1. row ***************************
ID: test/fk1
FOR_COL_NAME: parent_id
REF_COL_NAME: id
POS: 0
DESCRIBE
SHOW COLUMNS
PROCESS
INNODB_INDEXES
INDEX_ID | |
NAME | InnoDB
GEN_CLUST_INDEX
FOR_IND
|
TABLE_ID | INNODB_TABLES.TABLE_ID |
TYPE | A numeric value derived from bit-level information that identifies the index type. 0 = non-unique secondary index; 1 = automatically generated clustered index (GEN_CLUST_INDEX); 2 = unique non-clustered index; 3 = clustered index; 32 = full-text index; 64 = spatial index; 128 = secondary index on a |
N_FIELDS | GEN_CLUST_INDEX |
PAGE_NO | PAGE_NO
|
SPACE | InnoDB .ibd TRUNCATE TABLE |
MERGE_THRESHOLD | InnoDB |
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_INDEXES WHERE TABLE_ID = 34\G
*************************** 1. row ***************************
INDEX_ID: 39
NAME: GEN_CLUST_INDEX
TABLE_ID: 34
TYPE: 1
N_FIELDS: 0
PAGE_NO: 3
SPACE: 23
MERGE_THRESHOLD: 50
*************************** 2. row ***************************
INDEX_ID: 40
NAME: i1
TABLE_ID: 34
TYPE: 0
N_FIELDS: 1
PAGE_NO: 4
SPACE: 23
MERGE_THRESHOLD: 50
DESCRIBE
SHOW COLUMNS
PROCESS
INNODB_SESSION_TEMP_TABLESPACES
ID | |
SPACE | |
PATH | .ibt |
SIZE | |
STATE | ACTIVE
|
PURPOSE | INTRINSIC
NONE |
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_SESSION_TEMP_TABLESPACES;
+----+------------+----------------------------+-------+----------+-----------+
| ID | SPACE | PATH | SIZE | STATE | PURPOSE |
+----+------------+----------------------------+-------+----------+-----------+
| 8 | 4294566162 | ./#innodb_temp/temp_10.ibt | 81920 | ACTIVE | INTRINSIC |
| 8 | 4294566161 | ./#innodb_temp/temp_9.ibt | 98304 | ACTIVE | USER |
| 0 | 4294566153 | ./#innodb_temp/temp_1.ibt | 81920 | INACTIVE | NONE |
| 0 | 4294566154 | ./#innodb_temp/temp_2.ibt | 81920 | INACTIVE | NONE |
| 0 | 4294566155 | ./#innodb_temp/temp_3.ibt | 81920 | INACTIVE | NONE |
| 0 | 4294566156 | ./#innodb_temp/temp_4.ibt | 81920 | INACTIVE | NONE |
| 0 | 4294566157 | ./#innodb_temp/temp_5.ibt | 81920 | INACTIVE | NONE |
| 0 | 4294566158 | ./#innodb_temp/temp_6.ibt | 81920 | INACTIVE | NONE |
| 0 | 4294566159 | ./#innodb_temp/temp_7.ibt | 81920 | INACTIVE | NONE |
| 0 | 4294566160 | ./#innodb_temp/temp_8.ibt | 81920 | INACTIVE | NONE |
+----+------------+----------------------------+-------+----------+-----------+
DESCRIBE
SHOW COLUMNS
PROCESS
INNODB_TABLES
TABLE_ID | InnoDB |
NAME | test/t1 lower_case_table_names |
FLAG | DATA DIRECTORY CREATE TABLE ALTER TABLE |
N_COLS | InnoDB
DB_TRX_ID
|
SPACE | InnoDB TRUNCATE
TABLE |
ROW_FORMAT | |
ZIP_PAGE_SIZE | |
SPACE_TYPE | System
Single CREATE TABLE ALTER TABLE TABLESPACE=innodb_system General
CREATE
TABLESPACE |
INSTANT_COLS | ALTER TABLE ... ADD
COLUMN ALGORITHM=INSTANT |
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLES WHERE TABLE_ID = 214\G
*************************** 1. row ***************************
TABLE_ID: 214
NAME: test/t1
FLAG: 129
N_COLS: 4
SPACE: 233
ROW_FORMAT: Compact
ZIP_PAGE_SIZE: 0
SPACE_TYPE: General
INSTANT_COLS: 0
DESCRIBE
SHOW COLUMNS
PROCESS
INNODB_TABLES.FLAG
REDUNDANT
DYNAMIC
|
| |
INNODB_TABLES.ZIP_PAGE_SIZE |
| |
DYNAMIC
|
| |
DATA DIRECTORY CREATE TABLE ALTER TABLE datadir |
| |
CREATE TABLE ALTER TABLE TABLESPACE= |
|
t1
ROW_FORMAT=DYNAMIC
FLAG
FLAG
MySQL的> USE test;
数据库changedmysql > CREATE TABLE t1 (c1 int) ROW_FORMAT=DYNAMIC;
查询行,0行受影响(0.02秒)MySQL > SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLES WHERE NAME LIKE 'test/t1'\G
*************************** 1。行*************************** table_id:89名称:测试/ T1标志:33 n_cols:4空间:75 row_format:dynamiczip_page_size:0 instant_cols:01行集(0秒)
INNODB_TABLESPACES
INFORMATION_SCHEMA.FILES
SPACE | |
NAME | |
FLAG | |
ROW_FORMAT | |
PAGE_SIZE | |
ZIP_PAGE_SIZE | |
SPACE_TYPE | General
System |
FS_BLOCK_SIZE | InnoDB |
FILE_SIZE | InnoDB |
ALLOCATED_SIZE | InnoDB |
SERVER_VERSION | x y |
SPACE_VERSION | |
ENCRYPTION |
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES WHERE SPACE = 26\G
*************************** 1. row ***************************
SPACE: 26
NAME: test/t1
FLAG: 0
ROW_FORMAT: Compact or Redundant
PAGE_SIZE: 16384
ZIP_PAGE_SIZE: 0
SPACE_TYPE: Single
FS_BLOCK_SIZE: 4096
FILE_SIZE: 98304
ALLOCATED_SIZE: 65536
SERVER_VERSION: 8.0.4
SPACE_VERSION: 1
ENCRYPTION: N
DESCRIBE
SHOW COLUMNS
PROCESS
ROW_FORMAT
INNODB_TABLESPACES.FLAG
FLAG
DYNAMIC
REDUNDANT
INNODB_TABLES
COMPACT |
| |
KEY_BLOCK_SIZE |
| |
DYNAMIC
REDUNDANT
REDUNDANT
DYNAMIC CREATE
TABLESPACE |
| |
InnoDB |
| |
DATA DIRECTORY CREATE TABLE ALTER TABLE datadir |
| |
CREATE TABLESPACE |
| |
ibtmp1 |
|
t1
innodb_file_per_table=ON
INNODB_TABLESPACES
t1
DYNAMIC
innodb_page_size
mysql>USE test;
Database changed mysql>SHOW VARIABLES LIKE 'innodb_file_per_table';
+-----------------------+-------+ | Variable_name | Value | +-----------------------+-------+ | innodb_file_per_table | ON | +-----------------------+-------+ mysql>SHOW VARIABLES LIKE 'innodb_page_size';
+------------------+-------+ | Variable_name | Value | +------------------+-------+ | innodb_page_size | 16384 | +------------------+-------+ mysql>CREATE TABLE t1 (c1 int) ROW_FORMAT=DYNAMIC;
Query OK, 0 rows affected (0.02 sec) mysql>SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES WHERE NAME LIKE 'test/t1'\G
*************************** 1. row *************************** SPACE: 75 NAME: test/t1 FLAG: 33 ROW_FORMAT: Dynamic PAGE_SIZE: 16384 ZIP_PAGE_SIZE: 0 1 row in set (0.00 sec)
INNODB_TABLESPACES_BRIEF
INNODB_TABLESPACES
FILE_SIZE
INNODB_DATAFILES
SPACE | |
NAME | |
PATH | |
FLAG | |
SPACE_TYPE | General
Single
System
|
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_BRIEF WHERE SPACE = 7;
+-------+---------+---------------+-------+------------+
| SPACE | NAME | PATH | FLAG | SPACE_TYPE |
+-------+---------+---------------+-------+------------+
| 7 | test/t1 | ./test/t1.ibd | 16417 | Single |
+-------+---------+---------------+-------+------------+
DESCRIBE
SHOW COLUMNS
PROCESS
INNODB_TABLESTATS
InnoDB
InnoDB
DELETE
UPDATE
TABLE_ID | INNODB_TABLES.TABLE_ID |
NAME | INNODB_TABLES.NAME |
STATS_INITIALIZED | Initialized
|
NUM_ROWS | |
CLUST_INDEX_SIZE | InnoDB |
OTHER_INDEX_SIZE | |
MODIFIED_COUNTER | INSERT
DELETE |
AUTOINC | AUTOINC |
REF_COUNT |
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESTATS where TABLE_ID = 71\G
*************************** 1. row ***************************
TABLE_ID: 71
NAME: test/t1
STATS_INITIALIZED: Initialized
NUM_ROWS: 1
CLUST_INDEX_SIZE: 1
OTHER_INDEX_SIZE: 0
MODIFIED_COUNTER: 1
AUTOINC: 0
REF_COUNT: 1
DESCRIBE
SHOW COLUMNS
PROCESS
INNODB_VIRTUAL
INNODB_VIRTUAL
TABLE_ID | INNODB_TABLES.TABLE_ID |
POS | ((nth virtual generated
column for the InnoDB instance + 1) << 16) + the
ordinal position of the virtual generated column instance is the third column of the table, the formula is (0 + 1) << 16) + 2. The first virtual generated column in theInnoDB |
BASE_POS |
mysql>CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
`c` int(11) GENERATED ALWAYS AS (a+b) VIRTUAL,
`h` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
mysql>SELECT * FROM INFORMATION_SCHEMA.INNODB_VIRTUAL
WHERE TABLE_ID IN (SELECT TABLE_ID FROM INFORMATION_SCHEMA.INNODB_TABLES WHERE NAME LIKE "test/t1");
+----------+-------+----------+ | TABLE_ID | POS | BASE_POS | +----------+-------+----------+ | 98 | 65538 | 0 | | 98 | 65538 | 1 | +----------+-------+----------+
INNODB_VIRTUAL
MySQL的> CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
`c` int(11) GENERATED ALWAYS AS (5) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INNODB_COLUMNS
DESCRIBE
SHOW COLUMNS
PROCESS
INNODB_TEMP_TABLE_INFO
InnoDB
INNODB_TEMP_TABLE_INFO
TABLE_ID | |
NAME | |
N_COLS | InnoDB |
SPACE | InnoDB innodb_temp_data_file_path
data
|
mysql>CREATE TEMPORARY TABLE t1 (c1 INT PRIMARY KEY) ENGINE=INNODB;
Query OK, 0 rows affected (0.01 sec) mysql>SELECT * FROM INFORMATION_SCHEMA.INNODB_TEMP_TABLE_INFO\G
*************************** 1. row *************************** TABLE_ID: 97 NAME: #sql8c88_43_0 N_COLS: 4 SPACE: 76 1 row in set (0.00 sec)
DESCRIBE
SHOW COLUMNS
PROCESS
INNODB_TRX
TRX_ID | InnoDB |
TRX_WEIGHT | InnoDB |
TRX_STATE | RUNNING
ROLLING BACK
|
TRX_STARTED | |
TRX_REQUESTED_LOCK_ID | TRX_STATE
NULL
data_locks |
TRX_WAIT_STARTED | TRX_STATE
NULL |
TRX_MYSQL_THREAD_ID | ID PROCESSLIST |
TRX_QUERY | |
TRX_OPERATION_STATE | NULL |
TRX_TABLES_IN_USE | InnoDB |
TRX_TABLES_LOCKED | InnoDB |
TRX_LOCK_STRUCTS | |
TRX_LOCK_MEMORY_BYTES | |
TRX_ROWS_LOCKED | |
TRX_ROWS_MODIFIED | |
TRX_CONCURRENCY_TICKETS | innodb_concurrency_tickets |
TRX_ISOLATION_LEVEL | |
TRX_UNIQUE_CHECKS | |
TRX_FOREIGN_KEY_CHECKS | |
TRX_LAST_FOREIGN_KEY_ERROR | NULL |
TRX_ADAPTIVE_HASH_LATCHED | innodb_adaptive_hash_index_parts |
TRX_ADAPTIVE_HASH_TIMEOUT | innodb_adaptive_hash_index_parts |
TRX_IS_READ_ONLY | |
TRX_AUTOCOMMIT_NON_LOCKING | SELECT
LOCK
IN SHARED MODE autocommit
InnoDB |
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_TRX\G
*************************** 1. row ***************************
trx_id: 1510
trx_state: RUNNING
trx_started: 2014-11-19 13:24:40
trx_requested_lock_id: NULL
trx_wait_started: NULL
trx_weight: 586739
trx_mysql_thread_id: 2
trx_query: DELETE FROM employees.salaries WHERE salary > 65000
trx_operation_state: updating or deleting
trx_tables_in_use: 1
trx_tables_locked: 1
trx_lock_structs: 3003
trx_lock_memory_bytes: 450768
trx_rows_locked: 1407513
trx_rows_modified: 583736
trx_concurrency_tickets: 0
trx_isolation_level: REPEATABLE READ
trx_unique_checks: 1
trx_foreign_key_checks: 1
trx_last_foreign_key_error: NULL
trx_adaptive_hash_latched: 0
trx_adaptive_hash_timeout: 10000
trx_is_read_only: 0
trx_autocommit_non_locking: 0
DESCRIBE
SHOW COLUMNS
PROCESS
INFORMATION_SCHEMA
TP_THREAD_GROUP_STATE
TP_THREAD_GROUP_STATS
TP_THREAD_STATE
TP_THREAD_STATE
TP_THREAD_STATE
INFORMATION_SCHEMA
TP_THREAD_GROUP_STATE
TP_THREAD_GROUP_STATE
TP_GROUP_ID
CONSUMER THREADS
RESERVE_THREADS
CONNECT_THREAD_COUNT
CONNECTION_COUNT
QUEUED_QUERIES
QUEUED_TRANSACTIONS
STALL_LIMIT
thread_pool_stall_limit
PRIO_KICKUP_TIMER
thread_pool_prio_kickup_timer
ALGORITHM
thread_pool_algorithm
THREAD_COUNT
ACTIVE_THREAD_COUNT
STALLED_THREAD_COUNT
WAITING_THREAD_NUMBER
OLDEST_QUEUED
MAX_THREAD_IDS_IN_GROUP
MAX(TP_THREAD_NUMBER)
TP_THREAD_GROUP_STATE
选择tp_group_id,max_thread_ids_in_groupfrom tp_thread_group_state;选择tp_group_id,max(tp_thread_number)从tp_thread_state组tp_group_id;
TP_THREAD_GROUP_STATS
TP_THREAD_GROUP_STATS
TP_GROUP_ID
CONNECTIONS_STARTED
CONNECTIONS_CLOSED
QUERIES_EXECUTED
QUERIES_QUEUED
THREADS_STARTED
PRIO_KICKUPS
thread_pool_prio_kickup_timer
InnoDB
STALLED_QUERIES_EXECUTED
thread_pool_stall_limit
BECOME_CONSUMER_THREAD
BECOME_RESERVE_THREAD
BECOME_WAITING_THREAD
WAKE_THREAD_STALL_CHECKER
SLEEP_WAITS
THD_WAIT_SLEEP
SLEEP()
DISK_IO_WAITS
THD_WAIT_DISKIO
ROW_LOCK_WAITS
THD_WAIT_ROW_LOCK
GLOBAL_LOCK_WAITS
THD_WAIT_GLOBAL_LOCK
META_DATA_LOCK_WAITS
THD_WAIT_META_DATA_LOCK
TABLE_LOCK_WAITS
THD_WAIT_TABLE_LOCK
USER_LOCK_WAITS
THD_WAIT_USER_LOCK
BINLOG_WAITS
THD_WAIT_BINLOG_WAITS
GROUP_COMMIT_WAITS
THD_WAIT_GROUP_COMMIT
FSYNC_WAITS
THD_WAIT_SYNC
TP_THREAD_STATE
TP_THREAD_STATE
TP_GROUP_ID
TP_THREAD_NUMBER
TP_GROUP_ID
PROCESS_COUNT
WAIT_TYPE
NULL
xxx
_WAITTP_THREAD_GROUP_STATS
WAIT_TYPE
THD_WAIT_SLEEP | |
THD_WAIT_DISKIO | |
THD_WAIT_ROW_LOCK | |
THD_WAIT_GLOBAL_LOCK | |
THD_WAIT_META_DATA_LOCK | |
THD_WAIT_TABLE_LOCK | |
THD_WAIT_USER_LOCK | |
THD_WAIT_BINLOG | |
THD_WAIT_GROUP_COMMIT | |
THD_WAIT_SYNC |
INFORMATION_SCHEMA
CONNECTION_CONTROL_FAILED_LOGIN_ATTEMPTS
USERHOST
'
user_name
'@'host_name
'
FAILED_ATTEMPTS
USERHOST
connection_control_failed_connections_threshold
CONNECTION_CONTROL_FAILED_LOGIN_ATTEMPTS
connection_control_failed_connections_threshold
SHOW
INFORMATION_SCHEMA
SHOW DATABASES
SHOW TABLES
mysql> SHOW TABLES FROM INFORMATION_SCHEMA;
+---------------------------------------+
| Tables_in_INFORMATION_SCHEMA |
+---------------------------------------+
| CHARACTER_SETS |
| COLLATIONS |
| COLLATION_CHARACTER_SET_APPLICABILITY |
| COLUMNS |
| COLUMN_PRIVILEGES |
| ENGINES |
| EVENTS |
| FILES |
| KEY_COLUMN_USAGE |
| PARTITIONS |
| PLUGINS |
| PROCESSLIST |
| REFERENTIAL_CONSTRAINTS |
| ROUTINES |
| SCHEMATA |
| SCHEMA_PRIVILEGES |
| STATISTICS |
| TABLES |
| TABLE_CONSTRAINTS |
| TABLE_PRIVILEGES |
| TRIGGERS |
| USER_PRIVILEGES |
| VIEWS |
+---------------------------------------+
SHOW COLUMNS
DESCRIBE
SHOW
LIKE
SHOW CHARACTER SET SHOW COLLATION SHOW COLUMNS SHOW DATABASES SHOW FUNCTION STATUS SHOW INDEX SHOW OPEN TABLES SHOW PROCEDURE STATUS SHOW STATUS SHOW TABLE STATUS SHOW TABLES SHOW TRIGGERS SHOW VARIABLES
WHERE
SHOW
SHOW CHARACTER SET
MySQL的> SHOW CHARACTER SET;
---------- -----------------------------意图——| |默认字符集描述| collation | maxlen | ---------- -----------------------------意图——| BIG5 | BIG5传统华人华侨| BIG5 _ _ CI | 2 | | dec8 | DEC西部欧洲| dec8 _瑞典_ CI | 1 | | cp850 | DOS西欧洲| cp850 _ _将军祠| 1 | | hp8 |惠普欧洲西| hp8 _英语词_ | 1 | | koi8r | koi8-r列尔科姆网俄罗斯| koi8r _ _将军祠| 1 | | latin1 | cp1252西欧洲| latin1 _瑞典_ CI | 1 | | latin2 | ISO 8859-1 2中欧| latin2 _ _将军祠| 1 |…………………
WHERE
SHOW CHARACTER SET
mysql> SHOW CHARACTER SET WHERE `Default collation` LIKE '%japanese%';
+---------+---------------------------+---------------------+--------+
| Charset | Description | Default collation | Maxlen |
+---------+---------------------------+---------------------+--------+
| ujis | EUC-JP Japanese | ujis_japanese_ci | 3 |
| sjis | Shift-JIS Japanese | sjis_japanese_ci | 2 |
| cp932 | SJIS for Windows Japanese | cp932_japanese_ci | 2 |
| eucjpms | UJIS for Windows Japanese | eucjpms_japanese_ci | 3 |
+---------+---------------------------+---------------------+--------+
mysql> SHOW CHARACTER SET WHERE Maxlen > 1;
+---------+---------------------------+---------------------+--------+
| Charset | Description | Default collation | Maxlen |
+---------+---------------------------+---------------------+--------+
| big5 | Big5 Traditional Chinese | big5_chinese_ci | 2 |
| ujis | EUC-JP Japanese | ujis_japanese_ci | 3 |
| sjis | Shift-JIS Japanese | sjis_japanese_ci | 2 |
| euckr | EUC-KR Korean | euckr_korean_ci | 2 |
| gb2312 | GB2312 Simplified Chinese | gb2312_chinese_ci | 2 |
| gbk | GBK Simplified Chinese | gbk_chinese_ci | 2 |
| utf8 | gb3212 Unicode | utf8_general_ci | 3 |
| ucs2 | UCS-2 Unicode | ucs2_general_ci | 2 |
| cp932 | SJIS for Windows Japanese | cp932_japanese_ci | 2 |
| eucjpms | UJIS for Windows Japanese | eucjpms_japanese_ci | 3 |
+---------+---------------------------+---------------------+--------+