Have a Question?

If you have any question you can ask below or enter what you are looking for!

Using PhpMyAdmin To Export/Import Database

Managing MySQL databases is a common task when maintaining websites or applications. phpMyAdmin provides an easy‑to‑use web interface for exporting, importing, and running SQL queries without needing command‑line access.

This guide walks you through:

  • Exporting a database
  • Importing a database
  • Running SQL queries in phpMyAdmin

Accessing phpMyAdmin

You can usually access phpMyAdmin through your hosting control panel (e.g., cPanel, Plesk, or Jolt Control Panel hosting dashboard).

1. How to Export a Database in phpMyAdmin

Exporting a database creates a .sql file that you can download and store as a backup or migrate to another server.

Steps:

  1. Log in to phpMyAdmin.
  2. In the left sidebar, select the database you want to export.
  3. Click the Export tab at the top.
  4. Choose the export method:
    • Quick – recommended for most users.
    • Custom – allows advanced options such as selecting specific tables or compression.
  5. Choose the format (usually SQL).
  6. Click Go to download the file.

2. How to Import a Database in phpMyAdmin

Importing allows you to upload a .sql file into an existing or new database.

Before you begin

  • Ensure the database already exists (create one if needed).
  • If the file is large, zip the sql file before uploading.

Steps:

  1. Log in to phpMyAdmin.
  2. Select the target database from the left sidebar.
  3. Click the Import tab.
  4. Under File to import, click Choose File and select your .sql file.
  5. Leave most settings at their defaults unless you have specific requirements.
  6. Click Go to begin the import.

If successful, you’ll see a confirmation message.

NB: Database with contents may be overwitten by the contents of the import

3. Running SQL Queries in phpMyAdmin

phpMyAdmin includes a built‑in SQL editor where you can run custom SQL commands.

Step-by-step

  1. Select the database you want to work with.
  2. Click the SQL tab at the top.
  3. In the SQL editor box, type or paste your SQL query.
  4. Click Go to execute it.

Examples of common SQL queries

Create a table:

sql

CREATE TABLE example (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(255),
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

Update data:

sql

UPDATE users SET status = 'active' WHERE id = 1;

Delete data:

sql

DELETE FROM logs WHERE created_at < NOW() - INTERVAL 30 DAY;

Troubleshooting Tips

  • Import errors such as “max upload size exceeded” may require increasing PHP limits (upload_max_filesize, post_max_size) or using SSH/CLI instead.
  • Character encoding issues can be avoided by ensuring both export and import use the same collation (e.g., utf8mb4_general_ci).
  • Timeouts during import may require splitting large SQL files or importing via SSH mysql command.

© 2026 Jolt, a Freethought Group company encompassing Jolt, Freethought Internet, and Freethought Services. Jolt is a trading name of Host Lincoln Limited (06111631) registered in England and Wales at Unit 5, Oak House, Witham Park, Waterside South, Lincoln, LN5 7FB. Freethought® and the Freethought face are registered trademarks.
Visa MasterCard American Express PayPal Direct Debit Webmoney