Getting error while dropping or alter table

Hello,

Getting Error while dropping a table or trying to alter the same. I found that .ibd file wasn’t existing in data directory but the table seems to be present still in schema.

Below is the error while doing the drop or alter or any operations even ‘show create table tablename’ also was not allowing.

How to remove the below table name, even drop schema also doesn’t work same error gets pops up.

mysql> Drop table tablename;
ERROR 3506 (HY000) : indexes dictionary object is invalid. (The index has no elements.)

If you have the EXACT schema available, you can try: create the table in another database, EXPORT TABLESPACE, move this .ibd to the location of the table to drop, then try to drop it.

Thanks for the respons, Here I don’t have the exact schema and when i search for table in information_schema.tables I could see the table name with the partitions but without any columns.

I don’t have the table structure as well. Please suggest further.

Thanks!!

You don’t have any backups?

We are doing it on dev environment currently. We don’t have backups in dev, we had it only in prod environment

Since it’s dev, why not just take a fresh backup of prod and restore? I don’t see many options here since you do not have the schema of the table, you cannot recreate/redrop the table.

I tried doing the same taking fresh backup and restoring it on another new schema, it works well. Here the problem, even a new schema had all the data, older schema has to be dropped which is not allowing us to do it. Once this corrupted table can be removed we can try doing upgrade the dev instance to 8.0.36 from 8.0.22