![]() Other methods to single out the table required do exist. Next you can import the newly created table dump file into MySQL: mysql -u -p < examplecom_wp_options.sqlĪnd that’s it! This saved me more than once, that’s why I’ve now documented it here. ![]() This will copy data in the dump file mysql_examplecom.sql what is between DROP TABLE.*`wp_options` and reads until mysql is done dumping data to your table ( UNLOCK) into a new file. On your Bash shell, use sed to separate the data belonging to your table that needs restoring: sed -n -e '/DROP TABLE.*`wp_options`/,/UNLOCK TABLES/p' mysql_examplecom.sql > examplecom_wp_options.sql ![]() Talking about wp_options, did you know that you can optimize wp_options by adding an index on the autoload column? In my examples I use the WordPress wp_options table. Therefore, you first need to single out the table you want restored. Your mysqldump backup file might be hundreds MB’s in size. Restore a MySQL table from a mysqldump backup, using BashĪs outlined in the intro, there are a few required steps you need to perform to restore a single table from a mysqldump backup, because all your tables and data are in one file. There are a few steps required, I outline them here for you to restore the contents of just one table back into the database from the mysqldump using Bash. If you need to restore a single table from a full MySQL backup, you may find yourself wondering “how do I do that?”.
0 Comments
Leave a Reply. |