PDA

View Full Version : Help- how do I re-install my .sql file to db


LE1
01-06-2010, 11:40 AM
I was removing an old database from cpanel but accidently removed wrong one...................:eek:

I have a backup file .sql (exported from phpmyadmin)
how do i re-install it?

Please help..

LE1
01-06-2010, 11:47 AM
I have so far re-created the db in mysql (cpanel) with hopefully the right name?

and in phpmyadmin have imported the .sql file

Still something i,ve missed out???

LE1
01-06-2010, 07:50 PM
Sorted.

I needed to add user.

mOrloff
01-06-2010, 11:45 PM
Do you have shell access?
I just had to do my first restore yesterday, and I tried to do it via the SQL pane in phpMyAdmin, but that was taking forever. (At it's going rate, it would have taken more than a day and a half.)
I ended up resorting to SSH, and it took only about a minute or so.
I'm not very proficient at that, so I got some help, but I didn't take notes (I know, I know ... bad boy).

Maybe you can find a good tute on it.

I hope this helps at least a little.

~ mo

Old Pedant
01-07-2010, 01:06 AM
Well, the basics are pretty simple.

If you have a dump produced by mysqldump utility, all you have to do is issue the command line command:

mysql -uUUUU -pPPPP -h HHHH < nameOfDumpFile.sql

were UUUU is user name, PPPP is password, and HHHH is host (but -h and HHHH not needed if the server is localhost).

But you probably need to use the root user and root password, unless the dump was of a database owned by somebody else.

That works from a Windows DOS prompt as well as from Linux or Unix or whatever.

LE1
01-12-2010, 08:02 PM
Thanks guys,
but a bit over my head.

I could do with a bit of a guide on what else to back up and how,
incase of any more problems....

Any one know of a good tut.