Notes on MySQL command and mysqldump command
Want to exclude certain tables cause they are huge or problematic? Here you go, it can be done simply:
mysqldump -h 123.456.789.112 -u webuserprod -p --ignore-table=databasename.flag_content databasename > backupfile.sql
which means this:
-h = host and the number us the ip of the host, -u = username, -p = will specify a password, --ignore-table = obvious, state the database name and then concatenate it with a dot to the table name in this case that is flag_content and then one last time state the database name... the carrot (>) specifies that we want to backup FROM and the backupfile.sql is what we are calling our backup file which will be built in the directory we are calling the command from.
If you want to exclude more than one table use the --ignore-table flag repeatedly, restating the obvious, it works every time:
mysqldump -h 123.456.789.112 -u webuserprod -p --ignore-table=databasename.flag_content --ignore-table=databasename.cache_form --ignore-table=databasename.session_api databasename > backupfile.sql



Comments
Post new comment