• Resolved David

    (@loano1)


    I recently upgraded my WordPress installation on one of my staging sites to version 6.3. Post-upgrade, when I press the update database button as requested, I encountered multiple database errors related to primary keys and duplicate key names across various tables such as wp_usermeta, wp_termmeta, wp_term_taxonomy, etc.

    Is it still safe to use Index WP MySQL For Speed and keep the indexes during upgrades? Here the full error message:

    WordPress database error: [Multiple primary key defined]
    ALTER TABLE wp_usermeta ADD PRIMARY KEY (
    umeta_id) WordPress database error: [Duplicate key name 'user_id']
    ALTER TABLE wp_usermeta ADD KEY user_id (user_id) WordPress database error: [Duplicate key name 'meta_key']
    ALTER TABLE wp_usermeta ADD KEY meta_key (meta_key(191)) WordPress database error: [Multiple primary key defined]
    ALTER TABLE wp_termmeta ADD PRIMARY KEY (meta_id) WordPress database error: [Duplicate key name 'term_id']
    ALTER TABLE wp_termmeta ADD KEY term_id (term_id) WordPress database error: [Duplicate key name 'meta_key']
    ALTER TABLE wp_termmeta ADD KEY meta_key (meta_key(191)) WordPress database error: [Multiple primary key defined]
    ALTER TABLE wp_term_taxonomy ADD PRIMARY KEY (term_taxonomy_id) WordPress database error: [Multiple primary key defined]
    ALTER TABLE wp_commentmeta ADD PRIMARY KEY (meta_id) WordPress database error: [Duplicate key name 'comment_id']
    ALTER TABLE wp_commentmeta ADD KEY comment_id (comment_id) WordPress database error: [Duplicate key name 'meta_key']
    ALTER TABLE wp_commentmeta ADD KEY meta_key (meta_key(191)) WordPress database error: [Multiple primary key defined]
    ALTER TABLE wp_comments ADD PRIMARY KEY (comment_ID) WordPress database error: [Duplicate key name 'comment_approved_date_gmt']
    ALTER TABLE wp_comments ADD KEY comment_approved_date_gmt (comment_approved,comment_date_gmt) WordPress database error: [Duplicate key name 'comment_date_gmt']
    ALTER TABLE wp_comments ADD KEY comment_date_gmt (comment_date_gmt) WordPress database error: [Duplicate key name 'comment_parent']
    ALTER TABLE wp_comments ADD KEY comment_parent (comment_parent) WordPress database error: [Duplicate key name 'comment_author_email']
    ALTER TABLE wp_comments ADD KEY comment_author_email (comment_author_email(10)) WordPress database error: [Multiple primary key defined]
    ALTER TABLE wp_options ADD PRIMARY KEY (option_id) WordPress database error: [Multiple primary key defined]
    ALTER TABLE wp_postmeta ADD PRIMARY KEY (meta_id) WordPress database error: [Duplicate key name 'post_id']
    ALTER TABLE wp_postmeta ADD KEY post_id (post_id) WordPress database error: [Duplicate key name 'meta_key']
    ALTER TABLE wp_postmeta ADD KEY meta_key (meta_key(191)) WordPress database error: [Duplicate key name 'type_status_date']
    ALTER TABLE wp_posts ADD KEY type_status_date (post_type,post_status,post_date,ID) WordPress database error: [Duplicate key name 'post_parent']
    ALTER TABLE wp_posts ADD KEY post_parent (post_parent) WordPress database error: [Duplicate key name 'post_author']
    ALTER TABLE wp_posts ADD KEY post_author (post_author)
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author OllieJones

    (@olliejones)

    Thanks for the defect report.

    This is a benign problem. At the top of your dashboard you’ll get a notice box saying

    A recent WordPress version update may have changed your high-performance keys. Use the Index WP MySQL For Speed plugin to update your high-performance keys if necessary.

    Follow the link in the notice box and do the update operation, and you should be all set.

    This happens sometimes during a WordPress core version update because ordinary plugins don’t load in that workflow. (I’ve been trying to smack down this bug for quite a while with limited success, sorry about that.)

    I probably have same issue, just upgraded from 6.22 and log file shows bellow warning. The upgrade completed and site works.

    Should i run the plugin again or restore the keys?, i did not have the plugin installed. ( removed after i updated the keys)

    [20-Aug-2023 09:10:01 UTC] WordPress database error Duplicate key name ‘comment_date_gmt’ for query ALTER TABLE wp_comments ADD KEY comment_date_gmt (comment_date_gmt) made by wp_upgrade, make_db_current_silent, dbDelta

    [20-Aug-2023 09:10:01 UTC] WordPress database error Duplicate key name ‘comment_parent’ for query ALTER TABLE wp_comments ADD KEY comment_parent (comment_parent) made by wp_upgrade, make_db_current_silent, dbDelta

    [20-Aug-2023 09:10:01 UTC] WordPress database error Duplicate key name ‘comment_author_email’ for query ALTER TABLE wp_comments ADD KEY comment_author_email (comment_author_email(10)) made by wp_upgrade, make_db_current_silent, dbDelta [20-Aug-2023 09:10:01 UTC] WordPress database error Multiple primary key defined for query ALTER TABLE wp_options ADD PRIMARY KEY (option_id) made by wp_upgrade, make_db_current_silent, dbDelta [20-Aug-2023 09:10:01 UTC] WordPress database error Duplicate key name ‘type_status_date’ for query ALTER TABLE wp_posts ADD KEY type_status_date (post_type,post_status,post_date,ID) made by wp_upgrade, make_db_current_silent, dbDelta [20-Aug-2023 09:10:01 UTC] WordPress database error Duplicate key name ‘post_parent’ for query ALTER TABLE wp_posts ADD KEY post_parent (post_parent) made by wp_upgrade, make_db_current_silent, dbDelta [20-Aug-2023 09:10:01 UTC] WordPress database error Duplicate key name ‘post_author’ for query ALTER TABLE wp_posts ADD KEY post_author (post_author) made by wp_upgrade, make_db_current_silent, dbDelta

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Database Errors During WordPress Update 6.3’ is closed to new replies.