How you import a .sql file depends on your service.
Shared web hosting and WordPress hosting: phpMyAdmin
SSH is not open on our shared hosting server at the moment, so import the file with phpMyAdmin in cPanel:
- Log in to cPanel at https://cloud.lurstanhost.net:2083.
- If the database does not exist yet, create it under Databases with the MySQL Database Wizard. It creates the database and a user, and gives the user access. Database and user names start with your cPanel username and an underscore.
- Under Databases, open phpMyAdmin.
- Select the database in the list on the left.
- Open the Import tab, choose your .sql file, and select Import at the bottom of the page.
phpMyAdmin shows the largest file it accepts next to the file box. A compressed file such as backup.sql.gz or backup.sql.zip is smaller and quicker to upload. If your file is still too large, open a support ticket and we will help. We answer within one working hour, Monday to Friday, 08:30 to 17:30 (Lagos time).
Your website connects to the database with the host name localhost.
Linux VPS: the mysql command
On your own VPS, connect over SSH and run:
mysql -u USERNAME -p DATABASE_NAME < file.sql
Replace USERNAME with the database user, DATABASE_NAME with the database to import into and file.sql with the path to your file. You are then asked for the user's password.
For a compressed file, unpack it first with gunzip file.sql.gz or unzip file.sql.zip, then import the .sql file as above.
WordPress on a VPS: WP-CLI
If WP-CLI is installed, go to the WordPress folder and run:
wp db export before-import.sqlto keep a copy of the current database;wp db import file.sqlto import your file.
Then open the website and check that the content is there.

