MySQL 查看数据库表相关信息和自增 ID 方法如下:
方法一MariaDB [test]> show create table wikiarchive \G;
*************************** 1. row ***************************
Table: wikiarchive
Create Table: CREATE TABLE `wikiarchive` (
`ar_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`ar_namespace` int(11) NOT NULL DEFAULT '0',
`ar_title` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
`ar_text` mediumblob NOT NULL,
`ar_comment` varbinary(767) NOT NULL,
`ar_user` int(10) unsigned NOT NULL DEFAULT '0',
`ar_user_text` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`ar_id`),
KEY `name_title_timestamp` (`ar_namespace`,`ar_title`,`ar_timestamp`),
KEY `usertext_timestamp` (`ar_user_text`,`ar_timestamp`),
KEY `ar_revid` (`ar_rev_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8
1 row in set (0.00 sec)
ERROR: No query specified
方法 二MariaDB [test]> show table status like 'wikiarchive' \G
*************************** 1. row ***************************
Name: wikiarchive
Engine: InnoDB
Version: 10
Row_format: Compact
Rows: 0
Avg_row_length: 0
Data_length: 16384
Max_data_length: 0
Index_length: 49152
Data_free: 0
Auto_increment: 6
Create_time: 2017-03-02 09:53:39
Update_time: NULL
Check_time: NULL
Collation: utf8_general_ci
Checksum: NULL
Create_options:
Comment:
1 row in set (0.00 sec)