Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#36886 closed defect (bug) (invalid)

Automatic update to 4.5.2 caused error when DB was updated.

Reported by: BobNwp Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Upgrade/Install Keywords:
Focuses: Cc:


An automatic update was done (even though I had the proper settings in the config file to prevent auto updates) and when I logged into the site, I was told:

"WordPress has been updated! Before we send you on your way, we have to update your database to the newest version."

Output from the update was:

WordPress database error: [Unknown character set: 'UTF']
CREATE TABLE wp_termmeta ( meta_id bigint(20) unsigned NOT NULL auto_increment, term_id bigint(20) unsigned NOT NULL default '0', meta_key varchar(255) default NULL, meta_value longtext, PRIMARY KEY (meta_id), KEY term_id (term_id), KEY meta_key (meta_key(191)) ) DEFAULT CHARACTER SET UTF-8 Unicode
Update Complete

Your WordPress database has been successfully updated!

An error occurred but I'm told the database was successfully updated??

The update was to 4.5.2 and I think, it was from 4.3.1 This is a WP installation not yet in production and I would have updated it, and tested it, prior to going live with it.

You can read about my issues concerning automatic updates and why I want to control them at https://wordpress.org/support/topic/preventing-all-auto-updates-define-automatic_updater_disabled-true

I asked about the problem on the forum at https://wordpress.org/support/topic/an-auto-update-of-the-db-failed-with-an-error-any-ideas-as-to-cause

The update error was causing an error message in the side bar - that is documented in the forum post to which I just referred.

I resolved the problem, I think, via the processing in my last reply to the previously referenced forum post.

You have two problems -

1 - Telling me that the database update was successful when there is obviously an error.

2 - the error in the database update itself.

Let me know if there is any information you need.

Change History (3)

#1 @pento
4 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed
  • Version 4.5.2 deleted

Thanks for the bug report, @BobNwp!


This suggests that the problem is due to your DB_CHARSET being set incorrectly. It should be set to utf8 or utf8mb4, not UTF-8 Unicode.

Telling me that the database update was successful when there is obviously an error.

I agree that this could be better, I've created #36887 to separate this specific enhancement out from this ticket.

#2 @BobNwp
4 years ago

Are you referring to the setting in the config file:

/ Database Charset to use in creating database tables. */
define('DB_CHARSET', 'UTF-8 Unicode');

If so, I did not change it when I installed - I don't remember what it was, but I did not change it at anytime. If I did change it, in some period of zombie like behavior, I have no idea why I would have entered "UTF-8 Unicode"

I will change it to utf8. However, to test if that would prevent the error during the database update after the 4.5.2 update would be to drop back, code and database, to the pre-update state, make the change, run the update, and then wait for WP to update the database when I went to the site after the update.

I don't see that being feasible so I'll just make the change and let it set at there.

I read the ticket you created - you did not do anything to document the issue. I would think you would at least cite the example I gave in this ticket.

#3 @dd32
4 years ago

FWIW, define('DB_CHARSET', 'UTF-8 Unicode'); is something we've seen before, it was used in a bad example or 3rd party wp-config.php creation script at some point in time, but was most definitely your issue.
That constant should've been defined as utf8 only.

Note: See TracTickets for help on using tickets.