Era Host hosting
EraHost – Free Domain, Cheap Hosting!
Client Area
Support 24/7
Menu

Fixing MySQL Configuration for phpMyAdmin Export — System Administrator's Guide

4 min read
16.01.2026

Identify the MySQL Issue

Before modifying configurations, determine why MySQL export is failing.

MySQL phpMyAdmin Export Fix
phpMyAdmin export fails — raise limits, fall back to mysqldump.

For closely related MySQL admin / phpMyAdmin topics, see phpMyAdmin "Error During Session Start", MySQL Corrupt Database Files, and Increasing PHP Limits.

Check MySQL Error Logs

sudo tail -f /var/log/mysql/error.log

Common errors include:

MySQL server has gone away
Packet size too large
Lock wait timeout exceeded

Check MySQL Process List

mysql -u root -p -e "SHOW PROCESSLIST;"
  • If queries are stuck, it may be a timeout issue.
  • If queries are aborted, it may be packet size or memory-related.

Check phpMyAdmin Error Logs

tail -f /var/log/syslog | grep phpmyadmin

If errors appear, proceed with fixing MySQL configurations.

Linux VDS
High performance for your projects
  • Root access and flexible setup
  • Control panel
  • NVMe disks
  • DDR5
Linux VDS

Increase MySQL Configuration Limits

Edit the MySQL configuration file:

sudo nano /etc/mysql/my.cnf
# or (on some systems)
sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf

Add or modify the following sections:

Increase max_allowed_packet

If exporting large tables, increase the packet size:

[mysqld]

max_allowed_packet = 512M
Why? MySQL drops connections when the packet size is too small.

Increase Query Timeout Limits

If phpMyAdmin stops during export, increase:

[mysqld]

net_read_timeout = 600

net_write_timeout = 600

wait_timeout = 600

interactive_timeout = 600
Why? These values prevent long-running queries from timing out.

Increase innodb_buffer_pool_size for Large Databases

If the database is large, increase InnoDB memory:

[mysqld]

innodb_buffer_pool_size = 1G

innodb_log_file_size = 512M

innodb_log_buffer_size = 128M

innodb_flush_log_at_trx_commit = 2
Why? This improves read/write speeds and prevents slow exports.

Optimize tmp_table_size and max_heap_table_size

To prevent MySQL from using disk-based temp tables, increase:

[mysqld]

tmp_table_size = 512M

max_heap_table_size = 512M
Why? Ensures temporary tables fit in RAM, speeding up the export process.

Restart MySQL Service

After making changes, restart MySQL:

sudo systemctl restart mysql

Check if MySQL is running correctly:

sudo systemctl status mysql

Verify Configuration Changes

Run:

mysql -u root -p -e "SHOW VARIABLES LIKE 'max_allowed_packet';"
mysql -u root -p -e "SHOW VARIABLES LIKE 'wait_timeout';"
mysql -u root -p -e "SHOW VARIABLES LIKE 'innodb_buffer_pool_size';"

Ensure they match your updated settings.

Check and Repair Database Tables

If MySQL configuration changes do not fix the issue, check for corrupt tables.

Run a Full Check

mysqlcheck -u root -p --all-databases

Repair Corrupt Tables

mysqlcheck -u root -p --repair --all-databases

If a specific database is failing:

mysqlcheck -u root -p --repair database_name

Optimize Database for Faster Exports

If the export is still slow or failing, optimize the tables.

Defragment Tables

mysqlcheck -u root -p --optimize --all-databases

Manually Optimize Large Tables

If a single table is large, optimize it:

OPTIMIZE TABLE database_name.table_name;

Use mysqldump as an Alternative

If phpMyAdmin export still fails, use the command line:

mysqldump -u root -p database_name > /backup/database.sql

For large exports:

mysqldump -u root -p --max_allowed_packet=512M --single-transaction database_name > /backup/database.sql

If compression is needed:

mysqldump -u root -p database_name | gzip > /backup/database.sql.gz

Summary

Issue Fix
Export fails due to packet size Increase max_allowed_packet = 512M
Export times out Increase wait_timeout = 600
Large database export fails Increase innodb_buffer_pool_size = 1G
MySQL crashes during export Optimize database tables (OPTIMIZE TABLE)
Export still failing? Use mysqldump

By following this systematic MySQL configuration approach, a server administrator can fix phpMyAdmin export issues, ensure fast and stable database exports, and prevent timeouts or packet loss.

Frequently asked questions
With generous limits (memory_limit 512M, max_execution_time 0, max_allowed_packet 1G): up to ~1-2 GB SQL output. Beyond that, use mysqldump from shell — phpMyAdmin's UI overhead and PHP request lifecycle don't scale. Even at 500 MB, mysqldump is faster.
`CHECK TABLE ` from phpMyAdmin SQL tab. If "crashed" or "corrupted", REPAIR TABLE first (MyISAM) or innodb_force_recovery approach (InnoDB). Some tables export fine after repair; others need restore from backup. Don't let export silently skip corrupted tables — you'd miss data.
`mysqldump --single-transaction --routines --triggers -u -p | gzip > backup.sql.gz`. --single-transaction prevents locks on InnoDB. --routines and --triggers include stored procedures. gzip is essential for any DB > 100MB — 5-10x size reduction.
Yes for selective backups. phpMyAdmin's Export → Custom lets you pick tables individually, structure-only vs data-only, etc. Splits large export into manageable chunks. Combine with command-line for full backup, phpMyAdmin for ad-hoc table exports.
Related articles
Fixing ERR_INVALID_RESPONSE in phpMyAdmin — System Administrator's Guide
phpMyAdmin Export Not Working — Server Administrator's Troubleshooting Guide
Fixing "A Fatal Error or Timeout Occurred" by Increasing PHP Limits