Created
January 14, 2014 13:32
-
-
Save songlipeng2003/8418363 to your computer and use it in GitHub Desktop.
Extracting a table or a database from a mysql.sql dump file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# extract table | |
sed -n -e '/CREATE TABLE.*mytable/,/CREATE TABLE/p' mysql.sql > mytable.sql | |
# extract database | |
sed -n -e '/Current Database: `mydatabase`/,/Current Database: /p' mysql.sql > mydatabase.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment