TODO
- 獲取各個庫使用存儲
select table_schema, sum((data_length+index_length)/1024/1024) AS MB from information_schema.tables group by 1;
+----------------------+--------------+
| table_schema | MB |
+----------------------+--------------+
| anta_channel | 11.76562500 |
| anta_mw_order_prod | 4.23437500 |
| cardts | 5.18750000 |
| chaoxin | 8.04687500 |
| cloudcode | 0.14062500 |
| config-server-db | 0.03125000 |
- 建表時指定 auto increment 列初始值
CREATE TABLE `table1` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`value` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7
- myql 只准許每個表有一個列 auto increment 且必須爲主鍵
there can be only one auto column and it must be defined as a key