When encountering the error 1091: "Can't drop; check exists" in MySQL, the recommended immediate action is to verify the existence of the item (table, column, index, etc.) you are trying to drop. Use the appropriate query or command based on what you are attempting to drop:
SHOW TABLES LIKE 'yourtablename';
If this query returns a result, the table exists. If not, it's already been dropped or you might have the wrong table name.
SHOW COLUMNS FROM yourtablename LIKE 'yourcolumnname';
This will show if the column exists in your specified table. If it doesn't return any result, the column does not exist.
SHOW INDEX FROM yourtablename WHERE Keyname = 'yourindex_name';
This will display the index if it exists. No result means the index has already been dropped or the name is incorrect.
For all scenarios, ensure the names are correctly spelled and you are in the correct database context. You can select your database by using:USE yourdatabasename;
before running any of the above commands.
(Perfect for DevOps & SREs)
(Perfect for DevOps & SREs)



