423,350 Members | 2,519 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,350 IT Pros & Developers. It's quick & easy.

MYSQLDUMP, Create new database, before restoring SQL Data.

P: n/a
I can use mysqldump to create a .sql file backup of my data..

For importing how can I test to see if the DB exists, if it does
import the .sql

If not create the DB then import the .sql !

Thanks
Jul 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
<Frank @ MyPlace.Com (Frank)> wrote in message
news:3f****************@news.btclick.com...
I can use mysqldump to create a .sql file backup of my data..

For importing how can I test to see if the DB exists, if it does
import the .sql

If not create the DB then import the .sql !

Thanks


Dump the database with --opt --no-create-db

mysqldump --opt --no-create-db database [tables]
The manual SQL syntax would be something like

USE dbname IF EXISTS dbname;

Although I think the above commands accomplish what you want.

Regards,
Parallax
Jul 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.