Wordpress - Mysqldump add drop table?

It only affects the output of your MySQL dump in the file that is created.

It isn't necessary. It is just there so that if you import the created dump file into a database that already has a table with the same name, it will drop that table and then add the new table in its place. Otherwise you will get an error, and the dump file won't be imported.

It adds this line before the create table statement in the dump file:

DROP TABLE IF EXISTS `tablename`;

If you plan to import the dump file into a fresh database, it won't matter.


That's because the overall syntax goes something like:

mysql>mysqldump --opt --all-databses > all.sql

--opt is enabled by default (which implies: --add-drop-table) as mentioned in MySQL documentation.

Tags:

Mysql

Backup