Re: Creating a clean copy or schema backup
Posted by: Felix Geerinckx
Date: November 24, 2006 05:05AM

Use mysqldump to create SQL code for an empty database template

$ mysqldump -uuser -ppassword --no-data salesLeadsBrittany >salesLeadsTemplate.sql

Then, at the mysql> prompt:

mysql> CREATE DATABASE salesLeadsNormandy;
mysql> USE salesLeadsNormandy;
mysql> SOURCE /path/to/salesLeadsTemplate.sql;

CAVEAT EMPTOR: the above SQL code contains DROP TABLE statements. Do not run it on your production data or in the wrong database unless you are absolutely sure it works the way you want it to work. Make sure you have a working backup of all tables involved before running this code.


--
felix
Please use BBCode to format your messages in this forum.

Options: ReplyQuote


Subject
Written By
Posted
Re: Creating a clean copy or schema backup
November 24, 2006 05:05AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.