Error
Error Code:
3681
MySQL Error 3681: Schema Mismatch, Directory Found
Description
This error occurs when MySQL's internal data dictionary indicates that a schema (database) does not exist, but a physical directory corresponding to that schema's name is found within the MySQL data directory. It signals a discrepancy between MySQL's catalog and the filesystem, preventing normal database operations.
Error Message
Schema '%s' does not exist, but schema directory '%s' was found. This must be resolved manually (e.g. by moving the schema directory to another location).
Known Causes
3 known causesManual Directory Manipulation
A schema's physical directory was moved, renamed, or deleted directly via the operating system filesystem without using SQL commands, causing a desynchronization with MySQL's internal catalog.
Incomplete Schema Drop
A `DROP SCHEMA` or `DROP DATABASE` command failed or was interrupted, leading to the schema being removed from MySQL's internal catalog but leaving its physical directory intact.
Data Directory Migration Issues
Problems during the migration or restoration of MySQL data directories can lead to a mismatch where the filesystem has directories for schemas that MySQL no longer recognizes internally.
Solutions
Coming SoonGeneral Troubleshooting Tips
- Check the error message carefully for specific details
- Review recent changes that might have caused the error
- Search for the exact error code in the official documentation
- Check log files for additional context
- Try restarting the application or service