Import

What is Import in MySQL?

Import in MySQL means loading a previously saved database file (like .sql or .csv) back into phpMyAdmin. This is useful for restoring backups or moving databases to a new system.

Why Import a MySQL Database?

  • Restore Backup: To recover your database from a saved file.
  • Migration: To move data from one computer or server to another.
  • Data Sharing: To load a database shared by someone else.
  • Project Setup: To quickly set up sample data for testing.

How to Import a MySQL Database using phpMyAdmin
Step 1: Open phpMyAdmin

In your browser, go to: http://localhost/phpmyadmin/

Step 2: Create or Select a Database

If the database already exists, click on it. If not, create a new database with the same name as the one in the SQL file.

Step 3: Click on "Import" Tab

On the top menu, click the Import tab.

Step 4: Choose File

Click on the Browse button and select the file you want to import (e.g., student_db.sql or data.csv).

Step 5: Set Format (Optional)

Usually, phpMyAdmin automatically detects the file format. But you can choose SQL or CSV manually if needed.

Step 6: Click "Go"

Click the Go button to start the import process. If the file is correct, the data will be loaded into your database.

Steps With Image