Everything from Virtual Private Server (VPS) tips, to CCTV and more.
Random header image... Refresh for more!

Restoring a mysql backup.

Its easy enough to use phpmyadmin to restore backups, but its pretty limited when it comes to larger databases - so I tend to use the command line to restore those.

I usually export the file ‘zipped’ (you can do gzip if prefered, and alter the unzip part later) then ftp it to my server, to a location out of the webroot.

After using

unzip filename.sql.zip

you end up with the unzipped file, I normally delete the original zip to save space on the server at this point.

To import the database (you need to make sure you have already set up a database user in the control panel etc) use the following syntax

mysql -u username -ppassword database_name < unzipped-file.sql

then wait, whilst it imports.

0 comments

There are no comments yet...

Kick things off by filling out the form below.

Leave a Comment