Black Friday hosting deals · every offer with its renewal price

// wordpress & cpanel how-tos

How to enable the missing checkbox in phpMyAdmin table rows

Database problems happen, especially when you're a beginner. It happened to me once with a WordPress database where some tables looked broken: when I wanted to select a row to edit, export or delete it, there was no option at all. Even the checkbox was missing. If that's your case, follow these steps.

Why the checkbox disappears

phpMyAdmin shows the checkbox and the Edit, Copy and Delete links only when it can identify each row exactly. If a table has no primary key or unique column, it shows a message like "Current selection does not contain a unique column. Grid edit, checkbox, Edit, Copy and Delete features are not available." That happens after a bad import or migration, when the keys of a table are lost.

Back up your database before you change anything: in phpMyAdmin, select the database and click Export.

1. Set a primary key

This is the main cause. Click the table name, then Structure at the top, and you'll see all its columns. Find the ID column and click Primary (under More, in recent versions) to make it the primary key.

For WordPress tables, the ID column is the first one: option_id for wp_options, ID for wp_posts, comment_ID for wp_comments, and so on. If phpMyAdmin refuses because of duplicate values, the table has duplicated rows from the bad import, and you need to remove the duplicates first.

2. Restore AUTO_INCREMENT

This fixes many related problems, including the WordPress case where readers can't post a comment, or new posts save with an ID of 0. AUTO_INCREMENT gives each new row the next number automatically, so every row gets a unique ID.

In the table's Structure tab, click Change on the ID column. Make sure its type is INT (BIGINT for WordPress IDs), check the A_I box, which means AUTO_INCREMENT, and click Save. The column must also be the primary key from step 1.

3. Check for uppercase in the table name

Sometimes, even with a primary key, the problem comes from uppercase letters in the table name. On some servers, MySQL treats wp_Options and wp_options differently, and phpMyAdmin can lose track of the table's keys, so you can't select or export its rows. If your table name has uppercase letters, rename it to lowercase (and update your app's settings to match), then check again.

4. Ask your web host

Some hosts disable functions or run old versions of PHP, MySQL or phpMyAdmin, especially on shared hosting. Then the table options like edit, delete and copy may be missing or slow. Check with your host's support: they can update phpMyAdmin or repair the table for you.

If none of these solutions work, you may have a case specific to your database type. Try converting the table's engine from MyISAM to InnoDB in the Operations tab, or ask your host to upgrade MySQL or MariaDB. For more database work, see how to move a WordPress database.

FAQ

Why is there no checkbox in phpMyAdmin?

Because the table has no primary key or unique column, so phpMyAdmin can't identify each row. Add a primary key to the ID column in the Structure tab, and the checkbox, Edit, Copy and Delete options come back.

How do I add AUTO_INCREMENT in phpMyAdmin?

Open the table's Structure tab, click Change on the ID column, check the A_I box and save. The column must be an integer type and the table's primary key.

Keep reading

WRITTEN BY

Fathi Arfaoui

Fathi Arfaoui has helped people choose web hosting, start blogs and build WordPress sites since 2013. He founded SiteHostingFinder to replace opinion-based hosting reviews with real prices and public data. He has been a HostGator customer since 2013 and has hosted 40-50 WordPress sites on Pressable since 2017.