当前位置:网站首页>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 gbkSet the encoding set , Prevent Chinese data from being garbled--skip-commentsUncomment information--no-create-infoExport data only , Do not export table creation statements--no-create-dbExport data only , Do not export database creation statements--skip-add-drop-tableskipdropsentence-skip-add-locksCancel adding... Before each table exportLOCK TABLES--skip-disable-keysExport 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-insertUse with multiple VALUES Column INSERT grammar .
边栏推荐
- Unity3D学习笔记6——GPU实例化(1)
- Daily question 1: force deduction: 225: realize stack with queue
- 将MySQL的表数据纯净方式导出
- SQL Server生成自增序号
- GPS from getting started to giving up (XI), differential GPS
- Support multiple API versions in flask
- Aardio - 通过变量名将变量值整合到一串文本中
- qt quick项目offscreen模式下崩溃的问题处理
- go多样化定时任务通用实现与封装
- Leetcode question brushing (XI) -- sequential questions brushing 51 to 55
猜你喜欢

Senior soft test (Information System Project Manager) high frequency test site: project quality management

Oracle control file and log file management

小常识:保险中的“保全”是什么?

Web APIs DOM 时间对象

Leetcode exercise - Sword finger offer 26 Substructure of tree

【数字IC手撕代码】Verilog无毛刺时钟切换电路|题目|原理|设计|仿真

在IPv6中 链路本地地址的优势

Heavyweight news | softing fg-200 has obtained China 3C explosion-proof certification to provide safety assurance for customers' on-site testing

LeetCode 练习——剑指 Offer 26. 树的子结构
![[leetcode daily clock in] 1020 Number of enclaves](/img/2d/3d12f20c8c73fb28044c01be633c99.jpg)
[leetcode daily clock in] 1020 Number of enclaves
随机推荐
软考高级(信息系统项目管理师)高频考点:项目质量管理
Embedded common computing artifact excel, welcome to recommend skills to keep the document constantly updated and provide convenience for others
pytorch_YOLOX剪枝【附代码】
Inno Setup 打包及签名指南
HDR image reconstruction from a single exposure using deep CNNs阅读札记
Daily question 1: force deduction: 225: realize stack with queue
Management background --1 Create classification
墨西哥一架飞往美国的客机起飞后遭雷击 随后安全返航
网络基础入门理解
Common sense: what is "preservation" in insurance?
空结构体多大?
Anaconda installs third-party packages
OpenCV VideoCapture. Get() parameter details
Assembly and Interface Technology Experiment 6 - ADDA conversion experiment, AD acquisition system in interrupt mode
二叉(搜索)树的最近公共祖先 ●●
[sdx62] wcn685x will bdwlan Bin and bdwlan Txt mutual conversion operation method
变量与“零值”的比较
枚举与#define 宏的区别
Should novice programmers memorize code?
2021 geometry deep learning master Michael Bronstein long article analysis