LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   restore using mysqldump (http://www.linuxquestions.org/questions/linux-networking-3/restore-using-mysqldump-185911/)

sporkit 05-26-2004 12:16 AM

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! :cry:

LuggerHouse 05-26-2004 08:35 AM

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! :cry:

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!)

sporkit 05-26-2004 06:34 PM

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.


All times are GMT -5. The time now is 12:49 AM.