Hunter的大杂烩 技术学习笔记

2023-07-06

提取mysql dump文件中特定表的sql

Filed under: 技术话题 — hunter @ 9:33 pm
  1. 提取create table sql
    • perl -ne ‘print if /CREATE TABLE/../ENGINE=/’ dump.sql > create.sql
  2. 提取insert sql
    • sed -n -r “/^INSERT INTO \`(table1|table2|table3...)\`/p” dump.sql > data.sql

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress