MySQL Dump

To download your database to a .sql file via command line

mysqldump [options] -u DB_username -h localhost -p Database_name > file.sql

some useful options to include in your statement are:

Add a DROP DATABASE statement before each CREATE DATABASE statement. Added in MySQL 4.1.13.

     <code>--add-drop-database</code>

Add a DROP TABLE statement before each CREATE TABLE statement.

      <code>--add-drop-table</code>

Do not write any row information for the table. This is very useful if you want to get a dump of only the structure for a table.

      <code>--no-data, -d</code>

The most common dump call is:

mysqldump --opt -u DB_username -h localhost -p Database_name > file.sql
 
development/sql/mysql_dump.txt · Last modified: 2007/09/14 00:41 by vincenzobar
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki