当前位置:网站首页>将MySQL的表数据纯净方式导出
将MySQL的表数据纯净方式导出
2022-07-06 14:28:00 【枫叶梨花】
有时候我想导表,就是将一张表的数据导出,然后导入到另外一张表,但是直接使用mysqldump这个命令导出来的表数据,不够干净,不能直接导入,所以使用一些参数过滤信息。以下语句即可干净导出数据
mysqldump -uroot -h 127.0.0.1 -proot --databases test --tables user_info --where "id > 3" --default-character-set gbk --skip-comments --no-create-info --no-create-db --skip-add-drop-table --skip-add-locks --skip-disable-keys --skip-extended-insert --set-gtid-purged=off -c > C:\Users\Breeze\Desktop\test.sql
原表数据
导出的SQL文件数据
/*!40101 SET @[email protected]@CHARACTER_SET_CLIENT */;
/*!40101 SET @[email protected]@CHARACTER_SET_RESULTS */;
/*!40101 SET @[email protected]@COLLATION_CONNECTION */;
/*!40101 SET NAMES gbk */;
/*!40103 SET @[email protected]@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @[email protected]@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @[email protected]@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @[email protected]@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @[email protected]@SQL_NOTES, SQL_NOTES=0 */;
INSERT INTO `user_info` (`id`, `name`, `age`) VALUES (4,'Dave',24);
INSERT INTO `user_info` (`id`, `name`, `age`) VALUES (5,'Eva',24);
INSERT INTO `user_info` (`id`, `name`, `age`) VALUES (6,'Maybe',27);
/*!40103 SET [email protected]_TIME_ZONE */;
/*!40101 SET [email protected]_SQL_MODE */;
/*!40014 SET [email protected]_FOREIGN_KEY_CHECKS */;
/*!40014 SET [email protected]_UNIQUE_CHECKS */;
/*!40101 SET [email protected]_CHARACTER_SET_CLIENT */;
/*!40101 SET [email protected]_CHARACTER_SET_RESULTS */;
/*!40101 SET [email protected]_COLLATION_CONNECTION */;
/*!40111 SET [email protected]_SQL_NOTES */;
上述的SQL文件即比较干净的SQL脚本语句
--default-character-set gbk设置编码集,防止中文数据乱码--skip-comments取消附加注释信息--no-create-info只导出数据,不导出建表语句--no-create-db只导出数据,不导出建库语句--skip-add-drop-table跳过drop语句-skip-add-locks取消在每个表导出之前增加LOCK TABLES--skip-disable-keys导出更少的输出信息(用于调试)。去掉注释和头尾等结构。可以使用选项:--skip-add-drop-table --skip-add-locks --skip-comments --skip-disable-keys--skip-extended-insert使用具有多个VALUES列的INSERT语法。
边栏推荐
- Applet system update prompt, and force the applet to restart and use the new version
- 2020 Bioinformatics | GraphDTA: predicting drug target binding affinity with graph neural networks
- 硬件开发笔记(十): 硬件开发基本流程,制作一个USB转RS232的模块(九):创建CH340G/MAX232封装库sop-16并关联原理图元器件
- C#实现水晶报表绑定数据并实现打印4-条形码
- A Mexican airliner bound for the United States was struck by lightning after taking off and then returned safely
- Classic sql50 questions
- [linear algebra] determinant of order 1.3 n
- GPS从入门到放弃(十三)、接收机自主完好性监测(RAIM)
- About the professional ethics of programmers, let's talk about it from the way of craftsmanship and neatness
- ZABBIX proxy server and ZABBIX SNMP monitoring
猜你喜欢
![Some problems about the use of char[] array assignment through scanf..](/img/cf/d85a3172c5d29ac00377f9c30dbc4f.png)
Some problems about the use of char[] array assignment through scanf..

Chapter 4: talk about class loader again

Attack and defense world miscall

Unity3d Learning Notes 6 - GPU instantiation (1)

HDR image reconstruction from a single exposure using deep CNNs阅读札记

微信红包封面小程序源码-后台独立版-带测评积分功能源码

Assembly and interface technology experiment 5-8259 interrupt experiment

Common sense: what is "preservation" in insurance?

图像的spatial domain 和 frequency domain 图像压缩

ZABBIX proxy server and ZABBIX SNMP monitoring
随机推荐
MariaDb数据库管理系统的学习(一)安装示意图
二叉(搜索)树的最近公共祖先 ●●
Data processing skills (7): MATLAB reads the data in the text file TXT with mixed digital strings
GPS從入門到放弃(十三)、接收機自主完好性監測(RAIM)
Problems in the process of opencv300 cmake generating project
Attack and defense world miscall
GPS从入门到放弃(十六)、卫星时钟误差和卫星星历误差
[Digital IC hand tearing code] Verilog burr free clock switching circuit | topic | principle | design | simulation
Insert sort and Hill sort
Seata聚合 AT、TCC、SAGA 、 XA事务模式打造一站式的分布式事务解决方案
PVL EDI 项目案例
HDU 2008 数字统计
Seata aggregates at, TCC, Saga and XA transaction modes to create a one-stop distributed transaction solution
中国VOCs催化剂行业研究与投资战略报告(2022版)
ResNet-RS:谷歌领衔调优ResNet,性能全面超越EfficientNet系列 | 2021 arxiv
Management background --4, delete classification
Crawler obtains real estate data
Leetcode learning records (starting from the novice village, you can't kill out of the novice Village) ---1
Kohana database
GPS from entry to abandonment (XIV), ionospheric delay