In order to successfully complete a transfer of a website from one server to another, or from one installation to another, it is necessary to import the database that previously we will have “Exported” from another installation or another Hosting, task that is normally done from the hosting panel, through the tool phpMyAdmin.
Necessary step to be able to complete a transfer or a cloning of a website, and its correct performance depends to a great extent on it working and without errors Database Error: Unable to connect to the database: Could not connect to MySQL or similar, fruit of an incorrect management of the database or of not having connected correctly to the application.
As a general rule, what usually fails in most cases is assigning the appropriate permissions to the database user, causing subsequent connection errors to the database.
In this article we try to reveal this simple process so that you can “To import” correctly your databases whatever CMS you are using.
Import databases from the Hosting Panel (cPanel)
Summary steps to Import a database:
- Access the Hosting panel (cPanel).
- Go to Databases and create the new database or check if it already exists.
- If the database does not exist, proceed to create it from the section “Create a New Database”.
- Remember that the ideal is that the name of the database is not greater than 8 characters (without special characters).
- Established the database name click “Create Database”.
- From the section “Add New User” create the user for the new database.
- Set a password for the database user (we recommend using the generator).
- Established the user and the password (write down this information, you will need it) click on “Create User”.
- Grant the user permissions to use this new database from the option “Add User to Database”.
- Select the new database user (if you have several).
- Select the new database (if you have several).
- Click on Add.
- On the new screen, “Manage User Privileges” select all and click “Make changes”.
- Once the changes are applied, click “Backward”.
- Come back to “Home” cPanel.
- In section Databases go to phpMyAdmin.
- Once in phpMyAdmin select the new database (must be empty).
- In the upper tab click on “To import”.
- We select the file from our computer (.sql or the downloaded format).
- We click on “Continue” to proceed with the import of the database.
- If the process is successful we will see a message “in green” confirming the import.
Detailed steps with captures of the import process from a database:
First and important to be able to import A database is having the database file (.sql or compressed format) on your computer and also having created the database that will receive that import.
The process of creating a database is illustrated in the following link to a cPanel video.
In the creation of the database, it should be noted how important it is to apply all permissions to the created user so you can make use of the database.
Since phpMyAdmin, once the new database is selected, which must be empty (must not contain tables) we click on the top tab “To import” and from “Examine” select the previously downloaded file in our computer and click “Continue”.
Once imported, if the process has been carried out correctly, a message similar to the following will be displayed.
In the following video we explain more visually how to import a database from your Hosting panel (cPanel).
Member of the Websites Are Us technical team.
Coordinator of content on the Blog and YouTube.
Technical support in CyberProtector. Teacher at Websites Are Us Learning.