Murthy, if you want to dump database A and restore into database B, it's basically a 3-step process. You have to first create B, then dump A, then pipe the dump of A into B. Using the --no-data option with mysqldump will dump only structure, no data.

something like this:

mysql -u root -psecret -e 'create database test2'
mysqldump -u root -psecret --no-data test > test.sql
mysql -u root -psecret test2 < test.sql

You could also combine the last two steps into a one line operation, like so, for speed and to save disk space (new database still has to exist first):
mysql -u root -psecret -e 'create database test2'
mysqldump -u root -psecret --no-data test | mysql -u root -psecret test2


HTH,
Dan



murthy gandikota wrote:
Error 2013 went away when I typed  "create database sfg" at the mysql client 
prompt  before loading the dump. I have asked this before. Let me try again. How can I 
take the dump of a database db1 and load it into another database db2 on the same host? 
If this looks like a backup operation, please note that I am only interested in 
preserving the schema without the data. Is it possible to just transfer the schema to a 
new database?
Thanks

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to