导出数据和表结构:
mysqldump -u user_name -p pwd db_name > db_name.sql
只导出表结构
mysqldump -u user_name -p pwd -d db_name > db_name.sql
information_schema 信息
use information_schema;
#查询所有数据的大小:
select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables;
#查看指定数据库的大小:
select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables where table_schema='home';
#查看指定数据库的某个表的大小
select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables where table_schema='home' and table_name='members';