How do I import a .sql file via phpMyAdmin?

Quick Answer: Use phpMyAdmin's Import tab to upload and restore your .sql database file to your MariaDB database.

Overview

You can use phpMyAdmin to import an .SQL file with your database information. This is useful for restoring database backups, migrating data from another server, or setting up a new database with existing data.

Database Limit: Amicatek Link's shared web hosting offers 1 GB MySQL databases.

Step-by-Step Import Process

Step 1: Access phpMyAdmin

Log in to your database via phpMyAdmin using the following path:

  1. Go to https://cp.amicatek.link
  2. Click Manage Hosting
  3. Select your package
  4. Click phpMyAdmin
Navigation Path: cp.amicatek.link → Manage Hosting → [select package] → phpMyAdmin

Step 2: Select Your Database

Choose the database you want to import your .SQL file to from the left-hand side panel. The database list will appear on the left side of the phpMyAdmin interface.

Important: Make sure you select the correct database as the import will add data to this database.

Step 3: Access the Import Tab

Click the Import tab at the top of the page. This will open the import interface where you can upload your .sql file.

Step 4: Choose Your .SQL File

In the import interface:

  1. Click Choose File (or "Browse")
  2. Navigate to locate the .SQL file on your device or computer
  3. Select the file and click Open

Step 5: Execute the Import

Once you've selected your .sql file:

  1. Review the import settings (usually the defaults are fine)
  2. Click Go to start the import process
  3. Wait for the process to complete
Success: The .SQL file will be uploaded and imported to the database you've selected.

Import Settings and Options

File Format

phpMyAdmin supports several formats for database imports:

  • SQL: Standard SQL dump files (.sql)
  • Compressed SQL: Gzipped files (.sql.gz)
  • Zip files: Zipped SQL files (.zip)
  • CSV: Comma-separated values (.csv)

Character Set

Most imports work fine with the default character set (utf8), but you can change it if needed:

  • utf8_general_ci: General Unicode support
  • latin1: For older databases
  • utf8mb4: Full Unicode support including emojis

File Size Limitations

Upload Limits

phpMyAdmin has file upload size limits that may affect large database imports:

  • Maximum file size: Usually 50MB - 128MB
  • Maximum execution time: Scripts may timeout on very large imports
  • Memory limits: Large files may exceed PHP memory limits

Solutions for Large Files

If your .sql file is too large:

  • Compress the file: Use gzip compression (.sql.gz)
  • Split the file: Break large files into smaller chunks
  • Use command line: Import via SSH/terminal if available
  • Contact support: Our team can help with large database imports

Common Import Scenarios

WordPress Database Migration

When migrating a WordPress site:

  1. Export the database from your old hosting
  2. Create a new database in your Amicatek account
  3. Import the .sql file using the steps above
  4. Update wp-config.php with new database credentials

E-commerce Store Migration

For online stores (WooCommerce, Magento, etc.):

  • Backup first: Always backup your current database
  • Test thoroughly: Check all store functions after import
  • Update URLs: Change site URLs if necessary
  • Clear caches: Clear all caches after migration

Troubleshooting Import Issues

Common Error Messages

"File is too large"

Solution: Compress your .sql file or split it into smaller parts.

"MySQL server has gone away"

Solution: This usually indicates a timeout. Try importing smaller chunks of data.

"Duplicate entry" errors

Solution: The database already contains some of the data you're trying to import. Consider truncating tables first or using INSERT IGNORE statements.

"Unknown character set"

Solution: Check the character set of your .sql file and adjust the import settings accordingly.

Best Practices

  • Backup first: Always backup your existing database before importing
  • Test on staging: Test imports on a staging environment first
  • Check file integrity: Ensure your .sql file isn't corrupted
  • Monitor progress: Watch for error messages during import
  • Verify data: Check that all data imported correctly

After Import: Next Steps

Verify the Import

  1. Check table structure: Ensure all tables were created
  2. Verify data: Spot-check important records
  3. Test functionality: Test your application/website
  4. Check relationships: Ensure foreign keys work correctly

Update Application Settings

If you're migrating to a new server:

  • Database credentials: Update connection strings
  • URLs and paths: Update any hardcoded paths
  • Configuration files: Update config files as needed

Alternative Import Methods

Command Line Import

If you have SSH access, you can use the command line:

mysql -u username -p database_name < backup.sql

Third-Party Tools

Other tools for database management:

  • MySQL Workbench: Desktop application for database management
  • HeidiSQL: Free database client for Windows
  • Sequel Pro: macOS database management tool

Need Help with Database Import?

If you encounter issues importing your .sql file or need assistance with database migration, contact our support team through cp.amicatek.link. We can help with:

  • Large database imports
  • Complex migration scenarios
  • Troubleshooting import errors
  • Database optimization after import

Related Articles