All Collections
Getting Started
Creating Your Own Website
How to Upload and Set Up Your Database at Hostinger
How to Upload and Set Up Your Database at Hostinger

A step-by-step guide to importing and setting up a MySQL database at Hostinger

Updated today

If you have previously created a MySQL or MariaDB database and want to use it at Hostinger, you can easily import it and set it up. Here's what you need to do:

Step 1 - Preparation

First, make sure that your database file meets the following requirements:

  • The file format is .sql or

  • It does not contain commands to create or delete a database, such as DROP DATABASE IF EXISTS or CREATE DATABASE IF NOT EXISTS

  • There are no commands that require SUPER privileges, such as GRANT ALL PRIVILEGES

  • It does not include lines with DEFINER or PROCEDURE, or TRIGGER

If your project requires SUPER privileges for databases, you can consider migrating to a VPS plan 💡

Step 2 - Create a New Database

Navigate to Websites → Dashboard. Look for Databases on the left sidebar and select Management.

Next, enter the database name, username, and password. A detailed guide is available here: How to Create a New Database.

Step 3 - Import Your Database's Backup

Open your newly created database using phpMyAdmin, click Import and select the backup file from your computer. Here is a dedicated article with detailed steps: How to Import a Database With phpMyAdmin.

Step 4 - Update the Configuration File

If a database is required for your website to work properly, you will need to update the connection details in your website's configuration file.

The specific steps will vary depending on the type of content management system (CMS) you are using. However, in general, you will need to open the configuration file and update the database name, username, password, and host using the details of the new database.

Additional Resources

Did this answer your question?