如果想查看 Mysql 数据库的总的数据量或者某个表的数据或者索引大小,可以使用系统库 information_schema 来查询,这个系统库中有一个 TABLES 表,这个表是用来记录数据库中表的大小.行数.索引大小等信息 mysql > use information_schema; Database changed mysql > show create table TABLES; mysql > desc TABLES; 表结构如下: sql: CREATE TEMPORARY…
mysql查看表大小 一:命令 show table status like 'table_name'\G; mysql> show table status like 'x'\G; . row *************************** Name: x Engine: InnoDB Version: Row_format: Compact Rows: Avg_row_length: Data_length: Max_data_length: Index_length: Data_f…
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中,…
[1]Mysql 复制表数据(表结构相同) -- 方式一: create table table_name_dest as select * from table_name_src; -- 方式二: insert into table_name_dest select * from table_name_src; Good Good Study, Day Day Up. 顺序 选择 循环 总结…
//先进去MySQL自带管理库:information_schema //自己的数据库:rokid_cas_music_test //自己的表:data_song_thirdparty mysql> use information_schema; Database changed mysql> select data_length,index_length from information_schema.tables where table_schema='rokid_cas_music_te…
---收缩数据库日志文件 USE [master]ALTER DATABASE yourdatabasename SET RECOVERY SIMPLE WITH NO_WAITALTER DATABASE yourdatabasename SET RECOVERY SIMPLE USE yourdatabasename DBCC SHRINKFILE (N'yourdatabasename _Log' , 0,TRUNCATEONLY) --数据库日志文件名(数据库右键-属性-日志逻辑文件名)…
${database} 为数据库的名称 /*1.查看索引 (1)单位是GB*/ SELECT CONCAT(ROUND(SUM(index_length)/(**), ), ' GB') AS 'Total Index Size' FROM information_schema.TABLES WHERE table_schema LIKE '${database}'; /* +------------------+ | Total Index Size | +------------------…