Mysql导出表结构及表数据 mysqldump用法
命令行下具体用法如下: mysqldump -u用戶名 -p密码 -d 數據库名 表名 脚本名;
1、导出數據库為dbname的表结构(其中用戶名為root,密码為dbpasswd,生成的脚本名為db.sql)
mysqldump -uroot -pdbpasswd -d dbname >db.sql;
2、导出數據库為dbname某张表(test)结构
mysqldump -uroot -pdbpasswd -d dbname test>db.sql;
3、导出數據库為dbname所有表结构及表數據(不加-d)
mysqldump -uroot -pdbpasswd dbname >db.sql;
4、导出數據库為dbname某张表(test)结构及表數據(不加-d)
mysqldump -uroot -pdbpasswd dbname test>db.sql;
mysql查表大小
查整个库的状态:
select concat(truncate(sum(data_length)/1024/1024,2),'MB') as data_size,
concat(truncate(sum(max_data_length)/1024/1024,2),'MB') as max_data_size,
concat(truncate(sum(data_free)/1024/1024,2),'MB') as data_free,
concat(truncate(sum(index_length)/1024/1024,2),'MB') as index_size
from information_schema.tables where TABLE_SCHEMA = 'databasename';
查单表:
select concat(truncate(sum(data_length)/1024/1024,2),'MB') as data_size,
concat(truncate(sum(max_data_length)/1024/1024,2),'MB') as max_data_size,
concat(truncate(sum(data_free)/1024/1024,2),'MB') as data_free,
concat(truncate(sum(index_length)/1024/1024,2),'MB') as index_size
from information_schema.tables where TABLE_NAME = 'tablename';
2013年06月23日 15:24
Thanks for sharing your thoughts about 邵珠庆.
Regards
2012年03月13日 07:09
I have an ingrown hair on my chin. It looks like a spot, but it’s an ingrown hair. I cannot underline just how much it’s annoying me.
2012年01月24日 08:09
Kassettenmarkise test fleischkonsum statistik haarband zopf umtauschrecht saturn geretsrieder merkur beamtenkredit rechenmethoden franosch .
2012年03月05日 03:24
You can always tell an eexprt! Thanks for contributing.
2012年03月06日 12:33
That’s a smart way of tihnking about it.
2012年01月16日 00:39
Get Money With Scholarships for Minorities…
2012年03月04日 17:29
I relaly needed to find this info, thank God!
2012年03月06日 13:31
Play informative for me, Mr. itnernet writer.
2011年10月15日 10:06
好久没来了。来看看。
2011年10月14日 15:46
呵呵。
2011年10月30日 17:32
Clear, ifnormatvie, simple. Could I send you some e-hugs?
2011年12月25日 22:31
Yours is a cleevr way of thinking about it.
2012年03月04日 04:45
Full of salient points. Don’t stop believing or wirtnig!
2012年03月06日 13:18
I’m rellay into it, thanks for this great stuff!
2011年12月27日 14:16
Damn, I wish I could think of smoetnhig smart like that!
2012年03月04日 16:27
At last! Someone with the insight to solve the pbrolem!
2012年03月06日 12:34
Deep thniknig – adds a new dimension to it all.
2011年10月12日 11:53
好文,收藏了。