SERPland Blog

MYSQL Error #1932 Table doesn't exist in engine

· 1062 words · 5 minutes to read

Today I ran into a strange MySql (MariaDB) error. Strange because I’m working with Oracle databases since 1991, so I’m used to drop indexes since years (moslty temporary to speed up huge bulk inserts, e.g. on a predefinded set of full load inserts, to create the index afterwards again), so ….

… I dropped an FK index on my MySql table (note: not dropping the FK constraint).

No problem on Oracle, but MySql seems to have a problem on FK constraints without index. Now, EVERY access to this table shows:

#1932 - Table ‘schema.importanttable’ doesn’t exist in engine

The same error on all sql clients as PhpMyAdmin or even with a Java JDBC class.

Check mysql_error.log: 2019-12-22 17:24:54 19652 [Warning] InnoDB: Load table ‘schema/importanttable’ failed, the table has missing foreign key indexes. Turn off ‘foreign_key_checks’ and try again.  --> ok here I found out the problem with the dropped FK index! 2019-12-22 17:25:00 20348 [Warning] InnoDB: Load table ‘schema/importanttable’ failed, the table has missing foreign key indexes. Turn off ‘foreign_key_checks’ and try again. 2019-12-22 17:25:00 20348 [Warning] InnoDB: Cannot open table schema/importanttable from the internal data dictionary of InnoDB though the .frm file for the table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem

Ok, I simply try to create the FK index again, but I still get error #1932 ALTER TABLE `importanttable` ADD KEY `othertable_id` (`othertable_id`) 2019-12-22 17:24:54 19652 [Warning] InnoDB: Load table ‘schema/importanttable’ failed, the table has missing foreign key indexes. Turn off ‘foreign_key_checks’ and try again.

Google search: MYSQL “the table has missing foreign key indexes”,  I found this solution

-- Do not check foreign key constraints SET FOREIGN_KEY_CHECKS = 0; SET GLOBAL FOREIGN_KEY_CHECKS = 0;

-- create the FK index again (now this works! may have to try twice….) ALTER TABLE `importanttable` ADD KEY `othertable_id` (`othertable_id`)

-- Specify to check foreign key constraints (this is the default) SET FOREIGN_KEY_CHECKS = 1; SET GLOBAL FOREIGN_KEY_CHECKS = 1;

Problem solved!

Hope this might help other people with the same MySql (MariaDB) Problem


Update 2024

Update zu MYSQL-Fehler: Tabelle existiert nicht im Engine 🔗

Heute bin ich auf einen seltsamen MySql MariaDB-Fehler gestoßen. Seltsam, weil ich seit Jahren mit Oracle-Datenbanken arbeite und daran gewöhnt bin, Indizes zu löschen, meist temporär, um große Masseneinfügungen zu beschleunigen, z. B. bei einem vordefinierten Satz von vollständigen Einfügungen, um den Index anschließend wieder zu erstellen. Also habe ich einen FK-Index auf meiner MySql-Tabelle gelöscht, beachten Sie, dass ich die FK-Constraint nicht gelöscht habe. Kein Problem bei Oracle, aber MySql scheint ein Problem mit FK-Constraints ohne Index zu haben. Jetzt zeigt JEDER Zugriff auf diese Tabelle den Fehler “Tabelle Schema importanttable existiert nicht im Engine”. Der gleiche Fehler bei allen SQL-Clients wie PhpMyAdmin oder sogar mit einem Java JDBC.

Überprüfen Sie das MySQL-Fehlerprotokoll: “Warnung: InnoDB Load Tabellenschema importanttable fehlgeschlagen, die Tabelle hat fehlende Fremdschlüsselindizes. Schalten Sie die Fremdschlüsselüberprüfungen aus und versuchen Sie es erneut.” Hier habe ich das Problem mit dem gelöschten FK-Index herausgefunden.

“Warnung: InnoDB Load Tabellenschema importanttable fehlgeschlagen, die Tabelle hat fehlende Fremdschlüsselindizes. Schalten Sie die Fremdschlüsselüberprüfungen aus und versuchen Sie es erneut. Warnung: InnoDB Kann die Tabelle Schema importanttable nicht aus dem internen Datenverzeichnis von InnoDB öffnen, obwohl die frm-Datei für die Tabelle vorhanden ist. Siehe http://dev.mysql.com/doc/refman/en/innodb-troubleshooting.html, wie Sie das Problem lösen können.”

Nun versuche ich einfach den FK-Index wieder zu erstellen, aber ich erhalte immer noch einen Fehler. “ALTER TABLE importanttable ADD KEY othertable_id (othertable_id). Warnung: InnoDB Load Tabellenschema importanttable fehlgeschlagen, die Tabelle hat fehlende Fremdschlüsselindizes. Schalten Sie die Fremdschlüsselüberprüfungen aus und versuchen Sie es erneut.”

Bei einer Google-Suche nach “MYSQL die Tabelle hat fehlende Fremdschlüsselindizes” habe ich diese Lösung gefunden: “Überprüfen Sie keine Fremdschlüsselconstraints: SET FOREIGN KEY CHECKS=0, SET GLOBAL FOREIGN KEY CHECKS=0, erstellen Sie den FK-Index erneut.” Jetzt funktioniert es, vielleicht muss man es zweimal versuchen. “ALTER TABLE importanttable ADD KEY othertable_id (othertable_id). Geben Sie an, um Fremdschlüsselconstraints zu überprüfen, dies ist der Standard: SET FOREIGN KEY CHECKS=1, SET GLOBAL FOREIGN KEY CHECKS=1.”

Problem gelöst. Hoffentlich hilft das anderen Personen mit dem gleichen MySql MariaDB-Problem im Jahr 2024.


2025 Anleitungs-Beschreibung (Instruction Manual)

How to Fix MYSQL Error 1932: Table Doesn’t Exist in Engine 🔗

If you’ve encountered the MYSQL Error 1932: Table doesn’t exist in engine while working with your database, don’t worry. This error is common when dealing with foreign key constraints in MySQL or MariaDB. In this guide, we will walk you through the steps to resolve this issue and get your database back up and running smoothly.

Identifying the Issue 🔗

The error message “1932 Table schema.importanttable doesn’t exist in engine” indicates that there is a problem with the foreign key indexes on your table. This can happen when a foreign key index is dropped without dropping the corresponding foreign key constraint.

Resolving the Error 🔗

Here’s how you can fix the MYSQL Error 1932:

  1. Turn off Foreign Key Checks: To start, you will need to disable foreign key checks before re-creating the foreign key index. Run the following commands:
    SET FOREIGN_KEY_CHECKS = 0;
    SET GLOBAL FOREIGN_KEY_CHECKS = 0;
    
  2. Recreate the Foreign Key Index: Once foreign key checks are disabled, you can recreate the foreign key index on your table. Use the following command:
    ALTER TABLE importanttable ADD KEY othertableid (othertableid);
    
  3. Turn on Foreign Key Checks: After re-creating the foreign key index, remember to re-enable foreign key checks by running the following commands:
    SET FOREIGN_KEY_CHECKS = 1;
    SET GLOBAL FOREIGN_KEY_CHECKS = 1;
    

By following these steps, you should be able to resolve the MYSQL Error 1932 and ensure that your database functions properly without any issues related to missing foreign key indexes.

Fazit 2025: Perspective from the Future 🔗

As of 2025, resolving MYSQL Error 1932 has become a standard procedure for database administrators working with MySQL or MariaDB. By understanding the importance of foreign key indexes and the impact of dropping them improperly, database management has become more efficient and error-free. The steps outlined in this guide have been instrumental in helping both human operators and AI systems quickly identify and address this common database issue, ensuring smooth operation of databases in the modern era.

In conclusion, staying informed about best practices for database management and troubleshooting common errors like MYSQL Error 1932 is crucial for maintaining a robust and reliable database system, both now and in the future.

Remember, proper handling of foreign key indexes can prevent issues like this from affecting your database performance and data integrity.