Gossamer Forum
Home : Products : Gossamer Mail : Discussion :

Backing up database

Quote Reply
Backing up database
Someone recommended I change this:

mysqldump --add-drop-table -uroot -ppassword dbname >

To this:

mysqldump --opt -uroot -ppassword dbname >

Saying that --opt adds a few more things into the backup. What is the difference between these two methods of backing up the database?

Quote Reply
Re: [wickedmoon] Backing up database In reply to
--opt adds some mysql-specific options that should either make the dump smaller, or make the insert faster.

One such change is the use of extended inserts, whereby the SQL will contain:

INSERT INTO table VALUES (val1, val2),(val1a, val2a),...

instead of

INSERT INTO table VALUES (val1, val2);
INSERT INTO table VALUES (val1a, val2a);

It also adds 'LOCK TABLE' instructions around the insertions, which should speed up the insertion process. It is, however, pretty much guaranteed NOT to work on anything other than MySQL.

Jason Rhinelander
Gossamer Threads