Title: SQL errors when updating to latest version
Last modified: September 19, 2020

---

# SQL errors when updating to latest version

 *  Resolved [Alex Cicovic](https://wordpress.org/support/users/acicovic/)
 * (@acicovic)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/sql-errors-when-updating-to-latest-version/)
 * Hi,
 * After updating to the latest version, I have multiple occurrence of errors in
   the PHP error log like:
 * Specified key was too long; max key length is 1000 bytes
    ALTER TABLE `wp_mec_users`
   ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `email` (`email`);
 * Incorrect table definition; there can be only one auto column and it must be 
   defined as a key
    ALTER TABLE `wp_mec_users` MODIFY `id` int NOT NULL AUTO_INCREMENT;
 * Multiple primary key defined
    ALTER TABLE `wp_mec_occurrences` ADD PRIMARY KEY(`
   id`), ADD KEY `post_id` (`post_id`), ADD KEY `occurrence` (`occurrence`);
 * What do you suggest?
 * Thanks

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Contributor [webnus](https://wordpress.org/support/users/webnus/)
 * (@webnus)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/sql-errors-when-updating-to-latest-version/#post-13431654)
 * Hi [@acicovic](https://wordpress.org/support/users/acicovic/),
 * What is your MEC version?
    Please use the latest version of MEC [[version 5.12.0](https://webnus.net/modern-events-calendar/change-log/)],
   this is fixed in the latest version.
 * Best Regards
 *  [democle](https://wordpress.org/support/users/democle/)
 * (@democle)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/sql-errors-when-updating-to-latest-version/#post-13432310)
 * Hi [@webnus](https://wordpress.org/support/users/webnus/), I am performing a 
   migration and I get the same issue:
 * CREATE TABLE `wp_mec_users` (…..
 * #1071 – Specified key was too long; max key length is 767 bytes
 * I am using MEC 5.12.0
 *  Thread Starter [Alex Cicovic](https://wordpress.org/support/users/acicovic/)
 * (@acicovic)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/sql-errors-when-updating-to-latest-version/#post-13432343)
 * Hi,
 * I got this issue when updating to 5.12. My understanding is that the update process
   itself triggered them. So, the issue does not seem to be resolved for me, but
   rather caused by the 5.12 update itself.
 *  Plugin Contributor [webnus](https://wordpress.org/support/users/webnus/)
 * (@webnus)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/sql-errors-when-updating-to-latest-version/#post-13432397)
 * Hi [@acicovic](https://wordpress.org/support/users/acicovic/),
 * Alright, I have forwarded it to the developer team to be checked and fixed in
   the next updates.
    Thank you for your report, I have removed the “resolved label”.
 * Best Regards
 *  Thread Starter [Alex Cicovic](https://wordpress.org/support/users/acicovic/)
 * (@acicovic)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/sql-errors-when-updating-to-latest-version/#post-13496631)
 * Hello [@webnus](https://wordpress.org/support/users/webnus/),
 * What’s the status of this?
 * Should I run the queries manually? Should I update?
 * Thanks.
 *  Plugin Contributor [webnus](https://wordpress.org/support/users/webnus/)
 * (@webnus)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/sql-errors-when-updating-to-latest-version/#post-13496683)
 * Hi [@acicovic](https://wordpress.org/support/users/acicovic/),
 * In fact, we are fixed it in the latest version, so please make sure using the
   latest version of MEC [[version 5.12.5](https://webnus.net/modern-events-calendar/change-log/)].
 * Best Regards

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘SQL errors when updating to latest version’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/modern-events-calendar-lite_e2f4ff.
   svg)
 * [Modern Events Calendar Lite](https://wordpress.org/plugins/modern-events-calendar-lite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/modern-events-calendar-lite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/modern-events-calendar-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/modern-events-calendar-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/modern-events-calendar-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/modern-events-calendar-lite/reviews/)

## Tags

 * [sql-errors](https://wordpress.org/support/topic-tag/sql-errors/)
 * [update](https://wordpress.org/support/topic-tag/update/)

 * 6 replies
 * 3 participants
 * Last reply from: [webnus](https://wordpress.org/support/users/webnus/)
 * Last activity: [5 years, 8 months ago](https://wordpress.org/support/topic/sql-errors-when-updating-to-latest-version/#post-13496683)
 * Status: resolved