mysql 导出特定列的数据
2012-06-30 11:04
197 查看
MySQL导出指定表中的数据
要求:
1. 不导出创表的语句,因为表已经建好:默认会导出,先drop table然后create table;
2. 导出的insert语句加上ignore,允许重复执行:默认不会加上ignore;
3. insert语句中列出表中的字段,看得更清楚:默认不会; www.2cto.com
4. 分记录生成多条insert语句,修改起来比较容易:默认是一条;
最终结果如下:
mysqldump -pxxxxxx qzt qf1_mail_account --no-create-info --insert-ignore
--complete-insert --skip-extended-insert >qf1_mail_account.sql
其中:
-pxxxxxx 指定密码
qzt 数据库名
qf1_mail_account 表名
>qf1_mail_account.sql 保存到文件
www.2cto.com
mysqldump --help 写道
-t, --no-create-info
Don't write table creation info.
--insert-ignore Insert rows with INSERT IGNORE.
-c, --complete-insert
Use complete insert statements.
-e, --extended-insert
Use multiple-row INSERT syntax that include several
VALUES lists.
(Defaults to on; use --skip-extended-insert to disable.)
转载自http://www.2cto.com/database/201205/131159.html
要求:
1. 不导出创表的语句,因为表已经建好:默认会导出,先drop table然后create table;
2. 导出的insert语句加上ignore,允许重复执行:默认不会加上ignore;
3. insert语句中列出表中的字段,看得更清楚:默认不会; www.2cto.com
4. 分记录生成多条insert语句,修改起来比较容易:默认是一条;
最终结果如下:
mysqldump -pxxxxxx qzt qf1_mail_account --no-create-info --insert-ignore
--complete-insert --skip-extended-insert >qf1_mail_account.sql
其中:
-pxxxxxx 指定密码
qzt 数据库名
qf1_mail_account 表名
>qf1_mail_account.sql 保存到文件
www.2cto.com
mysqldump --help 写道
-t, --no-create-info
Don't write table creation info.
--insert-ignore Insert rows with INSERT IGNORE.
-c, --complete-insert
Use complete insert statements.
-e, --extended-insert
Use multiple-row INSERT syntax that include several
VALUES lists.
(Defaults to on; use --skip-extended-insert to disable.)
转载自http://www.2cto.com/database/201205/131159.html
相关文章推荐
- mysql导出特定的数据表结构及数据
- mysql导出命令 导出数据/结构/特定表结构
- mysql导出特定的数据表结构及数据
- Ubuntu命令行下MySQL数据导出与导入
- MySQL mysqldump数据导出详解
- mysqldump和mysql命令导出数据使用小结
- mysql数据导出
- 用命令从mysql中导出/导入表结构及数据
- mysql 导出表结构和表数据 mysqldump用法
- ubuntu命令行MySQL数据导入与导出
- MySQL利用Navicat导出数据字典
- MySQL数据导入导出的几种方法
- MYSQL数据导出乱码 MYSQL数据导入乱码
- PHP 将MySQL数据导出csv
- mysql 增量数据导出导入
- sqoop 导出 hive分区表 数据到 mysql
- Mysql导出表结构及表数据 mysqldump用法
- php将mysql数据以excel形式导出
- 命令行下 mysql数据导入,导出
- Navicat for mysql只导出数据表结构