How to Export Large MySQL Databases - Multiple Methods
Overview
This knowledge base article provides multiple methods for exporting large MySQL databases when standard phpMyAdmin exports fail due to size limitations, timeout issues, or memory constraints. Large databases (typically over 50MB) often require alternative export methods to ensure successful backup creation.
Prerequisites
- Active hosting account with iFastNet.com
- Access to your hosting control panel (cPanel)
- Database access credentials
- Sufficient local storage space for the exported file
Accessing Your Hosting Account
Method 1: Through iFastNet Client Portal
- Navigate to https://ifastnet.com/portal/clientarea.php
- Log in using your iFastNet account credentials
- Locate and click on your hosting service from the services list
- Click on "Login to cPanel" button
Method 2: Direct cPanel Access
- Navigate to https://yourdomain.com/cpanel (replace "yourdomain.com" with your actual domain name)
- Enter your cPanel username and password
- Once logged in, you'll have access to all hosting tools
Getting Support
If you encounter issues accessing your hosting account:
- Visit https://support.ifastnet.com/login.php
- If this is your first time accessing support, click "Register" to create a support account
- Once registered and logged in, create a new support ticket describing your access issue
Method 1: Export Individual Tables via phpMyAdmin
When to Use This Method
- Database is too large for complete export
- You only need specific tables
- phpMyAdmin times out on full database exports
- Memory limitations prevent complete export
Step-by-Step Instructions
Accessing phpMyAdmin
- From cPanel, scroll down to the "Databases" section
- Click on "phpMyAdmin" icon
- Select your database from the left sidebar
Exporting Individual Tables
-
Identify Large Tables:
- In phpMyAdmin, select your database
- Review the "Size" column to identify the largest tables
- Note tables that are significantly larger than others
-
Export Small to Medium Tables in Groups:
- Hold Ctrl (Windows) or Cmd (Mac) and click to select multiple smaller tables
- Click the "Export" tab
- Choose "Custom" export method
- Under "Output" section, select "Save output to a file"
- Set compression to "gzipped" to reduce file size
- Click "Go" to download the export file
-
Export Large Tables Individually:
- Select one large table at a time
- Click the "Export" tab
- Choose "Custom" export method
- Important Settings for Large Tables:
- Format: SQL
- Format-specific options: Check "Add DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT / TRIGGER statement"
- Object creation options: Check "Add CREATE PROCEDURE / FUNCTION / EVENT"
- Data creation options:
- Select "INSERT" for data dump method
- Check "Use delayed inserts"
- Check "Use ignore inserts"
- Under "Output" section:
- Select "Save output to a file"
- Set compression to "gzipped"
- Template name: Use
@DATABASE@_@TABLE@_@DATE@ for clear file naming
- Click "Go" to download
-
Create Export Log:
- Keep a text file listing all exported table files
- Note the export date and file sizes
- This helps track which tables have been exported
Troubleshooting Individual Table Exports
- If export still times out: Try exporting table structure and data separately
- For very large tables: Consider using the Terminal method (Method 2)
- Memory errors: Reduce the number of rows exported at once by using LIMIT in custom SQL
Method 2: Using cPanel Terminal with mysqldump
When to Use This Method
- Database is extremely large (100MB+)
- phpMyAdmin consistently times out
- You need the most reliable export method
- You're comfortable with command-line operations
Prerequisites for Terminal Method
- Terminal access enabled on your hosting account
- Basic familiarity with command-line operations
Accessing cPanel Terminal
- From cPanel main page, scroll down to "Advanced" section
- Click on "Terminal" icon
- A new browser tab will open with command-line access
Using mysqldump Commands
Basic Database Export
mysqldump -u [username] -p[password] [database_name] > /home/[your_username]/[database_name]_backup.sql
Export with Compression
mysqldump -u [username] -p[password] [database_name] | gzip > /home/[your_username]/[database_name]_backup.sql.gz
Export Large Database with Extended Insert Statements
mysqldump -u [username] -p[password] --single-transaction --routines --triggers --extended-insert [database_name] > /home/[your_username]/[database_name]_backup.sql
Export Specific Tables Only
mysqldump -u [username] -p[password] [database_name] table1 table2 table3 > /home/[your_username]/specific_tables_backup.sql
Export Database Structure Only (No Data)
mysqldump -u [username] -p[password] --no-data [database_name] > /home/[your_username]/[database_name]_structure.sql
Export Data Only (No Structure)
mysqldump -u [username] -p[password] --no-create-info [database_name] > /home/[your_username]/[database_name]_data.sql
Finding Your Database Credentials
- In cPanel, go to "Databases" section
- Click on "MySQL Databases"
- Your database name and username are listed there
- If you don't know the password, you can change it from this section
Downloading the Exported File
- After running mysqldump, the file is saved on the server
- In cPanel, go to "Files" section and click "File Manager"
- Navigate to your home directory (/home/[your_username]/)
- Locate your backup file
- Right-click and select "Download" to save it to your computer
Example Complete Terminal Session
# Navigate to home directory
cd /home/[your_username]/
# Create a backups folder
mkdir backups
cd backups
# Export the database with compression
mysqldump -u your_db_user -pyour_password --single-transaction --routines --triggers your_database_name | gzip > database_backup_$(date +%Y%m%d_%H%M%S).sql.gz
# Verify the file was created
ls -lh *.gz
# Check file size
du -h database_backup_*.gz
Method 3: Request Support Assistance
When to Use This Method
- You're not comfortable with technical procedures
- Database is extremely large (1GB+)
- Multiple export attempts have failed
- Time constraints require professional assistance
Requesting Export Support
-
Gather Required Information:
- Your domain name
- Database name you want exported
- Preferred export format (SQL file, compressed, etc.)
- Specific tables if you don't need the entire database
-
Create Support Ticket:
- Visit https://support.ifastnet.com/login.php
- Log in or register if this is your first time
- Click "Create New Ticket"
- Choose appropriate department (usually "Technical Support")
-
Ticket Content Template:
Subject: Database Export Request - Large Database
Hello,
I need assistance exporting a large MySQL database that is experiencing timeout issues through phpMyAdmin.
Domain: [your-domain.com]
Database Name: [your_database_name]
Estimated Database Size: [if known]
Export Requirements:
- [ ] Complete database export
- [ ] Specific tables only (list: table1, table2, etc.)
- [ ] Structure and data
- [ ] Structure only
- [ ] Data only
Preferred Format:
- [ ] Standard SQL file
- [ ] Compressed (gzipped) SQL file
Additional Notes: [Any specific requirements or issues encountered]
Please let me know the estimated time for completion and how the exported file will be provided.
Thank you for your assistance.
-
What to Expect:
- Response time: Typically 24-48 hours
- Export delivery: Usually via secure download link or file manager
- File format: Standard .sql or .sql.gz compressed file
Comparing Export Methods
| Method |
Best For |
Pros |
Cons |
Time Required |
| Individual Tables |
Medium databases (50-200MB) |
User control, partial exports possible |
Time-consuming for many tables |
15-45 minutes |
| Terminal/mysqldump |
Large databases (100MB+) |
Most reliable, fastest |
Requires command-line knowledge |
5-30 minutes |
| Support Request |
Any size, non-technical users |
Professional handling, no technical knowledge needed |
Longer wait time, dependent on support |
24-48 hours |
Best Practices and Tips
Before Starting Any Export
-
Check Database Size:
- In phpMyAdmin, view database size in the left sidebar
- Plan your export method based on size
-
Test During Low Traffic:
- Perform exports during off-peak hours
- Reduces server load and improves success rate
-
Verify Disk Space:
- Ensure adequate local storage for the export file
- Compressed exports are typically 60-80% smaller
Optimizing Export Success
- For phpMyAdmin: Use compression and export during low server load
- For mysqldump: Add
--single-transaction for InnoDB tables
- File naming: Use descriptive names with dates for easy identification
Security Considerations
- Protect exported files: Database exports contain sensitive data
- Secure deletion: Delete exports from the server after downloading
- Password protection: Consider encrypting large export files
Troubleshooting Common Issues
phpMyAdmin Timeout Errors
Error: "Script timeout exceeded"
Solution:
- Try exporting smaller table groups
- Use Terminal method instead
- Contact support for assistance
Terminal Access Issues
Error: "Terminal not available"
Solution:
- Check if Terminal is enabled in your hosting plan
- Contact iFastNet support to enable Terminal access
- Use support request method instead
Large File Download Problems
Error: Download interruptions or corruption
Solution:
- Use compression to reduce file size
- Try downloading during off-peak hours
- Consider splitting export into smaller files
Database Connection Errors in Terminal
Error: "Access denied for user"
Solution:
- Verify database username and password
- Check database privileges in cPanel
- Ensure you're using the correct database host (usually 'localhost')
Post-Export Verification
Verify Export Integrity
- Check file size: Compare to original database size
- Test import: Try importing to a test database
- Spot check data: Verify critical tables contain expected data
File Management
- Local backup: Store export files in multiple locations
- Cloud storage: Consider uploading to Google Drive, Dropbox, etc.
- Documentation: Keep records of export dates and contents
Conclusion
Exporting large MySQL databases requires choosing the right method based on database size, technical comfort level, and time constraints. phpMyAdmin individual table exports work well for medium databases, mysqldump via Terminal provides the most reliable solution for large databases, and support requests offer professional assistance when needed.
Always verify your exports and maintain multiple backup copies in different locations. Regular database exports are crucial for data protection and disaster recovery planning.