LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-25-2004, 11:16 PM   #1
sporkit
Member
 
Registered: Feb 2004
Posts: 71

Rep: Reputation: 15
restore using mysqldump


hello. after i had a server crash i need to backup all my databases. i ran a mysqldump and put everything into one file called all_back.sql.

here i am with a new server and trying to restore this. basicly the sql file has a commands to actually create the databases for me.
Code:
CREATE DATABASE /*!32312 IF NOT EXISTS*/ Jokes;
ive tried all sorts of different options to get this to dump everything back in without having to rename each databases. if i run something like
Code:
mysqldump -u root -p **** --all-databases < /files/all_back.sql
i get syntax errors.

the commands to create the databases are already in the file i just cant get mysql dump to put it back in!
 
Old 05-26-2004, 07:35 AM   #2
LuggerHouse
Member
 
Registered: May 2004
Location: Montreal,QC,Canada
Distribution: Fedora Core 7
Posts: 210

Rep: Reputation: 30
Re: restore using mysqldump

Quote:
Originally posted by sporkit
hello. after i had a server crash i need to backup all my databases. i ran a mysqldump and put everything into one file called all_back.sql.

here i am with a new server and trying to restore this. basicly the sql file has a commands to actually create the databases for me.
Code:
CREATE DATABASE /*!32312 IF NOT EXISTS*/ Jokes;
ive tried all sorts of different options to get this to dump everything back in without having to rename each databases. if i run something like
Code:
mysqldump -u root -p **** --all-databases < /files/all_back.sql
i get syntax errors.

the commands to create the databases are already in the file i just cant get mysql dump to put it back in!
Normaly if you get syntax error it means something is not right in your backup file... Try to do it a fiew lines at a time (but dont forget to backup your original file!)
 
Old 05-26-2004, 05:34 PM   #3
sporkit
Member
 
Registered: Feb 2004
Posts: 71

Original Poster
Rep: Reputation: 15
well im pretty sure the file is good. ive dumped mysql databases before but usually restore them while running the mysql program. ill type source then give the location to the file. this works if you already have the database selected and are using it.
 
  


Reply



Posting 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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mysqldump questions wh33t Programming 1 10-24-2005 08:07 PM
about mysqldump javier_ccs Programming 3 08-08-2005 06:13 PM
mysqldump - backup *.* bpk Linux - Newbie 1 03-29-2004 04:42 PM
MySQLDump and Cron duerra Linux - Newbie 6 02-20-2004 08:18 AM
compressing mysqldump output linen0ise Linux - Newbie 0 07-28-2003 07:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration