If your MySQL database backup is about >50MB, you are having a trouble when you try to restore the database backup file via cPanel or PHPMyAdmin. So the only way to restore the MySQL Database backup file is using SSH.
Here is the step on how to import MySQL Database via SSH:
- First, create MySQL database, MySQL user & MySQL Password in your cPanel.
- Upload the MySQL Database backup file to the server (ex: backup101.sql.gz)
Gunzip the file
$ gunzip backup101.sql.gz
Use this command to import the file into user account:
$ mysql database -u username -pdbpassword < backupfile.sql
$ mysql user_database -u user_username -ppasswordhere < backup101.sql- should same in step 1.
- Make sure ‘user_’ is your account name in cPanel that you have create in step 1.
- Replace passwordhere with the actual password and do not place a space after the -p before the password, it must be directly next to the -p with no space.
You are all set. Now check your PHPMyAdmin to make sure your MySQL Database backup file is exist.
comments powered by Disqus