Problem importing a mysqldump

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
AGISB
Forum Contributor
Posts: 422
Joined: Fri Jul 09, 2004 1:23 am

Problem importing a mysqldump

Post by AGISB »

I am duping the database contents (Mysql 4.0.20 on FreeBSD) from my life database. Now I want to import the dump into a freshly installed 5.0.18 on my local testserver (Suse Linux 10). I however get an error that I have an error in the mysql syntax.

I used

mysqldump -u root -p --opt --all-databases > backup.sql

and

mysql -u root -p < backup.sql


Is there a problem with different versions or have I overlooked something?
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

try mysql -u root -p

then it will prompt you for a password

then type \. backup.sql
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

You might want to disable the checking of constraints while inserting contents etc...
I wrote a simply shell script that should do that: http://timvw.madoka.be/programming/bash/myrestore.txt
Post Reply