473,396 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

MYSQLDUMP, Create new database, before restoring SQL Data.

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
1 4916
<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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Irvin Amoraal | last post by:
I am trying to create a CSV using mysqldump that will be viewed in MS Excel, and have a formatting question. From the command line I type: > mysqldump "--where=ent_date > \"2003-07-01\""...
7
by: Adam Smith | last post by:
Hope this is the right news group!! I did a server upgrade and at the same time did a mysql update from 4.0.12 to Ver 12.22 Distrib 4.0.16 mach1# mysql --version mysql Ver 12.22 Distrib...
0
by: Adam Smith | last post by:
Hello, I did a server upgrade and at the same time did a mysql update from 4.0.12 to Ver 12.22 Distrib 4.0.16. Essentially, moving from one machine to another. The dump consists of a cluster of...
0
by: Kim | last post by:
How do I restore a single database (selectively) from a mysql dump of many databases. ie: I have a server with a few databases on it, I have run: mysqldump --all-databases > all_databases.sql ...
1
by: Dave Crypto | last post by:
Hi there, SUMMARY: 1) When I use phpadmin to export a large database, the file created on my local PC never containes all the tables and information. It seems to max out at about 10mb. 2)...
3
by: Christopher Mouton | last post by:
We regularly make drive images of our entire server and store it at a backup site. To be honest I have never fully understood how the imaging programs deal with open files. My question is will the...
1
by: Greg.Harabedian | last post by:
I'll start off by saying I am using MySQL v4.0 and my question is...how do I get mysqldump to dump the actual binary values store in a blob? Here is an example: -- Create a test table create...
2
by: Vadim | last post by:
Hi! I succesfully exported my locally stored db using the following syntax: mysqldump -u root --password=111 finance > sqlbk.dump Now I created another empty db finance2 (on the same Mysql...
6
by: Antoni | last post by:
Hello, I'm trying to make a daily database backup. When executing "mysqldump - uxxx -pxxx database /home/backup/ddbb.sql -q &" the httpd server gets blocked and my site is "offline" for 30...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.