当前位置:网站首页>Export MySQL table data in pure mode
Export MySQL table data in pure mode
2022-07-06 22:27:00 【Maple Leaf pear flower】
Sometimes I want to guide my watch , Is to export the data of a table , Then import to another table , But directly mysqldump
The table data exported by this command , Not clean enough , Can't import directly , So use some parameters to filter information . The following statement can export data cleanly
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
Data in the original table
Derived SQL File data
/*!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 */;
Aforementioned SQL The file is relatively clean SQL Script statements
--default-character-set gbk
Set the encoding set , Prevent Chinese data from being garbled--skip-comments
Uncomment information--no-create-info
Export data only , Do not export table creation statements--no-create-db
Export data only , Do not export database creation statements--skip-add-drop-table
skipdrop
sentence-skip-add-locks
Cancel adding... Before each table exportLOCK TABLES
--skip-disable-keys
Export less output information ( For debugging ). Get rid of the comments and the head and tail structures . Options available :--skip-add-drop-table --skip-add-locks --skip-comments --skip-disable-keys
--skip-extended-insert
Use with multiple VALUES Column INSERT grammar .
边栏推荐
- Web APIs DOM time object
- 二分图判定
- C#实现水晶报表绑定数据并实现打印4-条形码
- Chapter 4: talk about class loader again
- 剑指offer刷题记录1
- Force buckle 575 Divide candy
- C # réalise la liaison des données du rapport Crystal et l'impression du Code à barres 4
- How do I write Flask's excellent debug log message to a file in production?
- OpenCV VideoCapture. Get() parameter details
- zabbix 代理服务器 与 zabbix-snmp 监控
猜你喜欢
NPDP认证|产品经理如何跨职能/跨团队沟通?
That's why you can't understand recursion
pytorch_YOLOX剪枝【附代码】
基于 QEMUv8 搭建 OP-TEE 开发环境
Management background --1 Create classification
Web APIs DOM 时间对象
2021 geometry deep learning master Michael Bronstein long article analysis
2500 common Chinese characters + 130 common Chinese and English characters
LeetCode 练习——剑指 Offer 26. 树的子结构
3DMAX assign face map
随机推荐
case 关键字后面的值有什么要求吗?
CCNA-思科网络 EIGRP协议
const关键字
Insert sort and Hill sort
基於 QEMUv8 搭建 OP-TEE 開發環境
Aardio - 利用customPlus库+plus构造一个多按钮组件
2022-07-05 使用tpcc对stonedb进行子查询测试
Installation and use of labelimg
2020 Bioinformatics | GraphDTA: predicting drug target binding affinity with graph neural networks
[sciter]: encapsulate the notification bar component based on sciter
Classification, function and usage of MySQL constraints
硬件开发笔记(十): 硬件开发基本流程,制作一个USB转RS232的模块(九):创建CH340G/MAX232封装库sop-16并关联原理图元器件
基于 QEMUv8 搭建 OP-TEE 开发环境
【sdx62】WCN685X将bdwlan.bin和bdwlan.txt相互转化操作方法
C#實現水晶報錶綁定數據並實現打印4-條形碼
Senior soft test (Information System Project Manager) high frequency test site: project quality management
Memorabilia of domestic database in June 2022 - ink Sky Wheel
Build op-tee development environment based on qemuv8
Management background --4, delete classification
Report on technological progress and development prospects of solid oxide fuel cells in China (2022 Edition)