Forum Moderators: open

Message Too Old, No Replies

Ugent help required

Restoring mySQL DB

         

PeteM

5:58 pm on Mar 13, 2006 (gmt 0)

10+ Year Member



I've messed up my database and need to restore.

My webhost has placed a directory containing the following restore files on my webspace.

/backup/db/dumps/db76099464
/backup/db/dumps/db76099464.dump.lzo
/backup/restore.tar

Now I have no idea what to do to restore my DB. I've tried phoning the webhost but they weren't very helpful.

So please HHHHEEELLLLPPPP!

Thanks, PEte

webdoctor

6:44 am on Mar 14, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Now I have no idea what to do to restore my DB

Have a look at the first few lines of the SQL dump. If it's a full database dump (that was made with the mysqldump command) you ought to be able to read through it and - at the top it should have all the table definition commands (CREATE TABLE), followed later by INSERT commands to add the data.

If it is a full dump, you basically just run this script through MySQL - so create yourself a new database e.g. restoreddb and then feed your database dump command to mysql - something like this:

mysql restoreddb < dumpfile.sql

Hope that makes sense.

percentages

6:58 am on Mar 14, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I agree with webdoctor, this looks like what your host has provided.

I've been in the position you are in today. Two things went through my head:

1. How the heck do I fix this?

2. Why the heck are my hosts so unhelpful? After all I pay them!

I eventually figured out #1, you will too.

#2 made me decide to switch hosts to a company that actually wants to help in these situations, that actually wants to help you out of the hole you probably got yourself into!

In business we should always look for good deals, but, we also need to look for people who truly want to help us succeed. So often (especially ISP's and Web Hosts), are companies that have zero interest in our businesses, they just look to get paid each month.

PeteM

7:32 am on Mar 14, 2006 (gmt 0)

10+ Year Member



Thanks guys, when I opened /backup/db/dumps/db76099464 using MSword I was able to see the sql commands to create and populate the table. I cut and pasted this into phpMySQLadmin and restored the table.

It was a valuable lesson to learn. Despite my host being "the world's number 1 web host" it took from Saturday afternoon to Monday lunchtime for them to provide the restore files. Even then they weren't that helpful. Should this have been a commercial site it would have been a real disaster.

Pete

henry0

1:30 pm on Mar 14, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do not rely on your host as only backup provider
run your own as often as possible

andye

4:58 pm on Mar 16, 2006 (gmt 0)

10+ Year Member



switch hosts to a company that actually wants to help in these situations

So true.

best, a.