Skip to main content

How to Import a MySQL or MariaDB Database With phpMyAdmin

You can import a MySQL or MariaDB database into your hosting account using the phpMyAdmin web interface. This process allows you to restore a database from a .sql or .sql.gz file or move a database from one location to another.

Before you begin

You will need:

  • A Hostek account with access to the control panel (cPanel or Windows Control Panel).

  • A valid MySQL or MariaDB database and a database user with the necessary permissions.

  • The database file (typically ending in .sql or .sql.gz) that you wish to import.

Import the database via phpMyAdmin

  1. Log in to your Hostek control panel.

  2. Navigate to the database management tool.

    • In cPanel, go to Databases > phpMyAdmin.

    • In Windows Control Panel, go to Databases > phpMyAdmin.

  3. In the left-hand sidebar of phpMyAdmin, click the name of the database you want to populate.

  4. Click the Import tab in the top navigation menu.

  5. Click Choose File (or Browse) and select the database file from your local computer.

  6. Leave the other settings (such as character set and format) at their default values unless you have a specific requirement.

  7. Click Go (or Import) at the bottom of the page.

Confirm the result

Once the import is complete, phpMyAdmin will display a success message.

  • You can verify the import by clicking the database name in the left sidebar and checking that the tables are listed.

  • You can click on a specific table to ensure the data is visible.

If the import fails due to a "Script timeout" or "Memory exhausted" error

These errors often occur when the database file is too large for the web server to process in a single request.

  1. Check the file size of your .sql file.

  2. If the file is large, try compressing it into a .gzip format before uploading.

  3. If the file remains too large for phpMyAdmin, you may need to split the .sql file into smaller segments or use a command-line tool to perform the import.

Limitations

This procedure is subject to the maximum upload limits of your hosting account. If your file exceeds the maximum allowed size for a web upload, the process may fail before it begins.

Did this answer your question?