Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I enabled Mollom and set up 3 forms. I disabled but now when re-enabled I get this error message:
"DatabaseSchemaObjectExistsException: Table mollom already exists. in DatabaseSchema->createTable() (line 657 of /Users/myusername/mywebsite/docroot/includes/database/schema.inc).
The website encountered an unexpected error. Please try again later. "
I'm using the Acquia Drupal distribution (which has the Mollom module in profiles > acquia > modules directory)
I tried to replace the module, clear cache/update.php/run cron but to no avail.
Comments
Comment #1
SunRhythms CreditAttribution: SunRhythms commentedIts your database... The Table is the actual Table in the database. It basically means there is a mismatch in data from your original database file and the one you currently have, but unfortunately it can't overwrite it. You have to actually uninstall the module and all of its required modules, fields, and other components and then delete the table item out of the MySql database then reinstall the module if you need it (unless you know how to rewrite the sql table information that is needed yourself, I'm assuming)...
Comment #2
Horroshow CreditAttribution: Horroshow commentedThanks SunRhythms, your post helped me a lot. Drupal returned exactly the same DatabaseSchemaObjectExistsException error ja_design mentioned when trying to use the Title module. I couldn't replace the title entity for a field.
I did exactly what you suggest:
- Uninstall the module from the Drupal (in my case Title module) and removed it from my Modules folder
- Launch PhpMyAdmin, find and drop the table mentioned in the error (in my case field_data_title_field and just in case I also dropped the field_revision_title_field too)
- Install the Title module again
Comment #3
sunUnfortunately, I'm not able to reproduce this error.
This normally should not happen, since you state that you only disabled the module. Disabling a module does not drop the module's database tables, and re-enabling a module does not re-install the module's database tables.
Something else in your site's setup must have gone wrong, unrelated to the Mollom module.
Comment #4
SunRhythms CreditAttribution: SunRhythms commentedSometimes uninstalling doesn't work. Unfortunately, in my case, there was a problem with backup-migrate holding on to tables after a new reinstall of the database.. I don't know why it happened but I knew that the tables were still there after I uninstalled the module and still had the error message after reinstall.
Comment #5
mexicoder CreditAttribution: mexicoder commentedHi @SunRhythms, glad I stumbled across your post,was running into exactly the same issue. There is more about it here On restore, delete tables that didn't exist at time of backup
Comment #5.0
mexicoder CreditAttribution: mexicoder commentedFor privacy concerns I replaced my name/website with generic paths
Comment #6
cooldeeponline CreditAttribution: cooldeeponline commentedjust clear your cache, it goes.
Comment #7
kerrycurtain CreditAttribution: kerrycurtain commentedConfirming that #6 works perfectly, thanks cooldeeponline. May have to repeat this after every error if you have multiple modules involved.
Comment #8
oakulm CreditAttribution: oakulm commentedI also got this error when migrating db from server to server. #6 did the trick how ever.
Comment #9
gbrands CreditAttribution: gbrands commentedClearing the entire cache never worked for me; it would always error out before the issue was resolved. However, manually emptying the 'cache_field' table solved my issue with the table already exists warning:
MySQL:
Drush: