You can import an SQL file into a MySQL database using phpMyAdmin. This is useful when restoring a database backup or moving a website from another hosting account.
Before you start, make sure the database already exists. If you are replacing an existing website database, take a fresh backup first.
To import a database:
- Log in to the client area at https://clients.4uhosting.co.uk.
- Choose My Services.
- Find the hosting service and select Manage.
- Select Login to cPanel from the left side.
- Open phpMyAdmin.
- Select the database from the left side.
- Choose the Import tab.
- Select the SQL file from your computer.
- Leave the format as SQL.
- Select Import or Go.
phpMyAdmin will upload the file and run the SQL statements inside it. If the import is successful, you should see a confirmation message.
If the import fails, check the error message carefully. Common causes include a file that is too large, a database user without the right permissions or SQL that tries to create a database that already exists.
For WordPress websites, the database name, username and password must also match the details in the site’s configuration file. If those details are wrong, the import may complete but the website still may not connect to the database.
If you are not sure whether it is safe to import a database, please contact support before making changes.