Web Hosting Geeks | Web Hosting Experts
Need help? Call us 1(866)TOP-HOST

14625 reviews 1734 hosting providers

Questions & Answers

Restore Mysql

Apr 11, 2012 by Susan3
Hello all,

I am using webmin + kloxo and I have VPS server (root access)  and I  have a 500MB databsase that I’m trying to restore using my CMS Datalife backup and restore option. When restoring my datadase, for the first 5 minutes I can see that the tables are being restored but after sometime it just stops restoring and nothing moves anymore.
Can someone please help me fix this.

2 Answers

0 votes
Apr 11, 2012 by lionhost
If you have root access, it’s better to do the backup via ssh. You can upload the database backup using ftp under your website home directory, then ssh to the server and use the mysql command (mysql -uroot -p db_name < /home/backup/dbbackup.sql) to restore the backup.
0 votes
Apr 11, 2012 by ZakWeb
Open your ssh/telnet client and log into your website. The command line prompt you will see will vary depending on the OS and it should bring you into the FTP root folder.

from there you can change directories to wherever the backup is located and type in the following:

mysql -u dbusername -p databasename < backupname.sql

Or if you do not want to change directories and you know the path to where the backup is located, type in the following:

mysql -u dbusername -p databasename < /path/to/backupname.sql

You will be prompted for the database password. Enter it and the database will backup.

If your hosting company has you on a remote MySQL server, such as mysql.yourhost.com, you will need to add the servername to the command line. The servername will be the same as in your config.php. The command line will be:

mysql -h servername -u dbusername -p databasename < backupname.sql