Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > How to restore MySQL database

How to restore MySQL database
Thread Tools
Mac Enthusiast
Join Date: Jan 2001
Location: Leesburg, Virginia
Status: Offline
Reply With Quote
May 23, 2005, 09:23 PM
 
I am running a third-party freeware application that has assembled data in a MySQL database. When I had to rebuild the server from scratch I saved the database to a flat file using one of the methods using the mysqldump command, as described in Apple Support Article 107852, which jibes with my third-party application's documentation.

However, when I attempt to restore the database from the .sql file I am informed through an error message that
ERROR 1049: Unknown database '********'
Some investigation into what this error message might mean, raised the suggestion that I might have to initialize MySQL with the name of the database I would like to restore first. However, I don't know how to do that.

Any ideas?
     
Senior User
Join Date: Nov 2001
Location: State of Denial
Status: Offline
Reply With Quote
May 23, 2005, 11:46 PM
 
Yes, you have to create the database first:

create database foo;

in the MySQL console, where 'foo' is the name of your database.

Then you can go

mysql -p foo < foo.sql
[Wevah setPostCount:[Wevah postCount] + 1];
     
Mac Enthusiast
Join Date: Jan 2001
Location: Leesburg, Virginia
Status: Offline
Reply With Quote
May 24, 2005, 09:57 AM
 
Thank you very much for saving me the trouble of digging through a MySQL text! -- Dominik
     
Senior User
Join Date: Nov 2001
Location: State of Denial
Status: Offline
Reply With Quote
May 24, 2005, 12:50 PM
 
No problem!
[Wevah setPostCount:[Wevah postCount] + 1];
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 07:21 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2