phpMyAdmin Shows Approximate Row Counts – Fix It

phpMyAdmin shows approximate row counts for InnoDB tables because it guesses. Force exact counts or switch to MariaDB 10.3+ for real numbers.

Quick answer

Edit config.inc.php and set $cfg['MaxExactCount'] = 0; to force exact counts for all tables. Or upgrade to MariaDB 10.3+ which stores exact row counts in information_schema.

Why does phpMyAdmin show approximate row counts?

If you're using InnoDB tables (which most of you are), SHOW TABLE STATUS gives an estimated row count. InnoDB doesn't keep a running exact count – it's too expensive for transaction-heavy databases. So phpMyAdmin shows the estimate with an "Approximate" label.

I had a client last month who panicked because her WooCommerce orders table showed "Approximate: 5,000" but she had 12,000 orders. The store was fine, but the number scared her.

By default, phpMyAdmin uses a threshold. If a table has more rows than $cfg['MaxExactCount'] (default is 20,000), it shows the approximation. You can change that.

Step-by-step fix

  1. Find your phpMyAdmin config file. Usually at /etc/phpmyadmin/config.inc.php or /usr/share/phpmyadmin/config.inc.php on Linux. On Windows, it's in the phpMyAdmin folder.
  2. Open it in a text editor (e.g., sudo nano /etc/phpmyadmin/config.inc.php).
  3. Add or change this line:
    $cfg['MaxExactCount'] = 0;
    Setting it to 0 tells phpMyAdmin to always do an exact count, no matter how many rows.
  4. Save the file and restart your web server:
    sudo systemctl restart apache2
    Or for Nginx:
    sudo systemctl restart nginx
  5. Refresh phpMyAdmin and check any table. The "Approximate" label should be gone. You'll now see exact numbers like 12,347 instead of ~12,000.

What if the fix doesn't work?

If you still see approximate counts, try these:

  • Check the value in $cfg['Servers'][$i]['MaxExactCount'] – some setups override the global setting per server. Add the line inside the server array block.
  • Clear your browser cache – phpMyAdmin caches some info. Hard refresh (Ctrl+F5) or clear cookies.
  • Switch to MariaDB 10.3+ – This version stores exact row counts in information_schema.TABLES.ROW_COUNT. phpMyAdmin 5.0+ uses it automatically. If you're still on MySQL 5.7 or older, this fix works but MariaDB is better.

Prevention tip

Don't set MaxExactCount too low on huge tables (millions of rows). Exact counts on a 10-million-row InnoDB table can take 10–30 seconds and slow down phpMyAdmin. A better approach: keep the default threshold at 20,000 or raise it to 100,000 if your server can handle it. Use $cfg['MaxExactCount'] = 100000; – that way small tables show exact counts quickly, and huge ones fall back to approximation.

If you're on shared hosting and can't edit config files, ask your host to increase MaxExactCount or upgrade to MariaDB 10.3+. Most decent hosts will do it with a ticket.

Real-world story: I had a dental clinic client with a 4-million-row appointments table. Setting MaxExactCount = 0 crashed phpMyAdmin because the query took 45 seconds. Had to revert it to 500,000 and live with approximations for that one table. Moral of the story: test first.

Related Errors in Database Errors
Index Fragmentation Above Threshold: Fix in 3 Steps 0X8004D00D XACT_E_NOTCURRENT (0X8004D00D) Fix: Transaction Not Current 0X00001A40 Fix 0x1A40 Transaction Manager Name Collision on SQL Server NULL Why MySQL index not used? Fix slow queries fast

Was this solution helpful?

EP
Erropedia Team
Tech Support Editors
The Erropedia editorial team researches and documents real-world tech errors from across Windows, Linux, macOS, networking, databases, cloud platforms, and more. Every solution is reviewed for accuracy and updated as software and systems evolve.