Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

How to dump an MySQL/InnoDB database

Answer:

To do a point-in-time SQL dump of a InnoDB database, use the mysqldump command with the --single-transaction flag

# mysqldump --master-data=2 --single-transaction huge_db > backup.sql

The binlog position will be written in the backup.sql, which is very useful for database recovery if needed.

  1. Dump the table schema of a MySQL database
  2. Create MySQL Dump that ignore duplicate key error when import back to MySQL
  3. How to perform hot backup for InnoDB
  4. How to rename database in MySQL
  5. Export MySQL database as XML file

One Response to “How to dump an MySQL/InnoDB database”

  1. [...] MySQL, the only way to REORG a table is to export the data, e.g. using mysqldump, then import the data into MySQL [...]

Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>