First have a look at the InnoDB Architecture (from Percona CTO Vadim Tkachenko)
Your problem is very simple. You have a broken data dictionary entry. Inside the system tablespace file
ibdata1 is a list of tablespace ids.
There is an entry for
appointments.business_users. Deleting the
appointments.business_users does not remove its tablespace id from the data dictionary. You need to remove that entry from the data dictionary.
The reason you are getting the error still ? Although you can the
CREATE TABLE and generated the
.ibd file, the tablespace id in the
.ibd file does not match the original tablespace id in the data dictionary.
Here are some old posts on how to repair it in place
If the database isn't too big, you could do the following:
- mysqldump everything EXCEPT
- drop all databases (except mysql schema)
- shutdown mysql
- delete ibdata1
- start mysql (recreated ibdata1)
- reload the mysqldump
- manually run the
CREATE TABLE command for
Either way, you have some homework to do.