Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Illegal mix of collations
Sometimes when performing queries directly in the TXP database.
for example
bc.. set from="some text";set
to=“some other text”;
UPDATE `textpattern` SET `Title`=replace(`Title`, from,
to);
recently on late TXP builds I get the following error
Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT), (utf8mb4_general_ci,IMPLICIT), (utf8mb4_general_ci,IMPLICIT) for operation 'replace'
- Did something change in recent revs of textpattern that relates to the tables collation?
- is it safe for me to simply change all the tables to
utf8mb4_unicode_ci
?
The following script will do it… but is it wise?
#Convert the database
ALTER DATABASE mrdale_wow_stage CHARACTER SET utf8 COLLATE utf8_unicode_ci;
# Convert all the tables
ALTER TABLE textpattern CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE txp_category CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE txp_css CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE txp_discuss CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE txp_discuss_nonce CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE txp_file CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE txp_form CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE txp_image CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE txp_lang CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE txp_link CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE txp_log CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE txp_page CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE txp_plugin CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE txp_prefs CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE txp_section CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE txp_token CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE txp_users CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
Update… I still get the error.
Offline
Pages: 1