Understand phpMyAdmin MySQL Connection Compression

$cfg['Servers'][$i]['compress'] compresses traffic between the PHP process running phpMyAdmin and the MySQL server. It does not compress the browser connection, SQL dump files, CSV downloads, table storage, or backups.

Last updated: November 6, 2026.

<?php
$i = 1;
$cfg['Servers'][$i]['host'] = 'db.internal.example';
$cfg['Servers'][$i]['compress'] = true;

// Keep TLS verification configured separately.
$cfg['Servers'][$i]['ssl'] = true;
$cfg['Servers'][$i]['ssl_verify'] = true;

The setting passes the MySQL client-compression flag to mysqli for this phpMyAdmin server entry. Compression and encryption solve different problems; enabling compression must not weaken TLS verification.

What the option changes

The current phpMyAdmin configuration reference says the option enables client/server protocol compression and defaults to false. It applies only to connections opened by phpMyAdmin for that configured database server.

MySQL’s connection compression guide explains that client and server negotiate a compressed protocol. Repeated text and large result sets may shrink substantially, but already-compressed BLOB data, images, and archives usually do not. The database still stores the same bytes and executes the same query.

Enable it only after measuring

Compression can help when phpMyAdmin and MySQL are separated by a slow, metered, or high-latency network. On the same host or a fast private network, the extra CPU work can cost more than the saved bandwidth. Measure a representative export and a large result set with the option off and on; compare wall time, transferred bytes, and CPU on both endpoints.

Do not use protocol compression as a workaround for unbounded queries. Keep result limits, indexes, and pagination in place. For remote administration, require TLS with certificate verification because compression does not provide confidentiality or server authentication.

If phpMyAdmin becomes unreachable after changing configuration, revert this single option and confirm that the PHP mysqli extension and server support the negotiated mode. Continue with lightweight MySQL administration, MySQL connection troubleshooting, and checking MySQL configuration.

Related Web Cheat Sheet guides

Sergey Kornilov

Sergey Kornilov