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 >
/path/to/database/dbname_sql.txt

To this:

mysqldump --opt -uroot -ppassword dbname >
/path/to/database/dbname_sql.txt

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

Jason
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
jason@gossamer-threads.com