Last active
January 16, 2023 19:56
-
-
Save tofirius/db6e061a60fe7cd4253bf9a555a0a9b2 to your computer and use it in GitHub Desktop.
MySQL dump of tables that begin with a given prefix
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
mysql database_name -u username -pPassWord -N -e 'show tables like "tableprefix\_%"' | xargs mysqldump database_name -u username -pPassWord > prefixedtable_dump.sql |
Thanks for this! Quick edit - second command should use -u
instead of --u
.
Thanks for this! Quick edit - second command should use
-u
instead of--u
.
Thanks for the catch @jjack-vertex !
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is particularly handy if you need to update only Wordpress tables within a database that is used for other purposes.