Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem restoring MySQL db

Status
Not open for further replies.

RexJacobus

Programmer
Dec 10, 2001
47
0
0
NZ
I am trying to restore the nightly backup to a test db.

I log into the Unix shell and navigate to the backup directory. I type in mysql -u root -p <PWD> testDB < bkup.txt.gz.

I get no error msgs just the "mySQL Ver 14.7 ... (and then all the mysql command-line options)"

When I look in testDB nothing has changed.

What am I doing wrong? I am a coder who has been thrown into a database pool and can't swim.

Jim
 
I don't think it matters, but try unzipping the file first.
gunzip testdb.txt.gz
Then...
mysql -u root -p <PWD> testDB < bkup.txt

Mark
 
I've unzipped and tried
mysql -u root -p <PWD> test < bkup.txt

I still got no results and no error msgs.

I've also tried it where the destination database is completely empty. I get the same results as when I try to backup the existing testing db.

Jim


 
Remove the password and let it prompt.

To backup...
mysqldump -u root -p testdb > bkup.txt
it will prompt for the password.

To restore...
mysql -u root -p testdb < bkup.txt
it will prompt for the password.

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top