Calculate index sizes mysql> SELECT CONCAT(ROUND(SUM(index_length)/(1024*1024*1024), 2), ' GB') AS 'Total Index Size' FROM information_schema.TABLES WHERE table_schema LIKE 'database'; +------------------+ | Total Index Size | +------------------+ | 1.70 GB | +------------------+ 1 row in set (1.60 sec) To calculate the total size of the data in the database mysql> SELECT CONCAT(ROUND(SUM...
mysql查看表结构命令,如下: desc 表名; show columns from 表名; describe 表名; show create table 表名; use information_schema select * from columns where table_name='表名'; 顺便记下: show databases; use 数据库名; show tables; 原有一unique索引AK_PAS_Name(PAC_Name)在表tb_webparamcounter中, 执行以下sql修改索引 alter table tb_webparamcounter drop index AK_PAS_Name; alter table tb_webparamcounter add U...
如果想知道mysql数据库中每个表占用的空间、表记录的行数的话,可以打开mysql的 information_schema 数据库。在该库中有一个 TABLES 表,这个表主要字段分别是:
TABLE_SCHEMA : 数据库名
TABLE_NAME:表名
ENGINE:所使用的存储引擎
TABLES_ROWS:记录数
DATA_LENGTH:数据大小
INDEX_LENGTH:索引大小
其他字段请参考mysql的手册,我们只需要了解这几个就足够了。
所以要知道一个表...
如果想知道mysql数据库中每个表占用的空间、表记录的行数的话,可以打开mysql的 information_schema 数据库。在该库中有一个 TABLES 表,这个表主要字段分别是: TABLE_SCHEMA : 数据库名 TABLE_NAME:表名 ENGINE:所使用的存储引擎 TABLES_ROWS:记录数 DATA_LENGTH:数据大小 INDEX_LENGTH:索引大小 其他字段请参考mysql的手册,我们只需要了解这几个就足够了。 所以要知道一个表占用空间的大小,那就相当于是 数据大小 + ...
查看表的引擎类型等状态信息: show table status from [root@mail ~]# mysql -h 192.168.1.250 -uroot -p -e "show table status from upload\G"|grep -A1 -B1 -i name ... *************************** 30. row *************************** Name: ac_upload_system_announce Engine: MyISAM -- *************************** 31. row *************************** Name: ac_uplo...