Saturday, November 13, 2021

Moodle MySQL collation warning

While upgrading Moodle on one of our sites, There was a warning, with a link to https://docs.moodle.org/311/en/MySQL_full_unicode_support

The admin of the site reported, 

Received an error message, "Error writing to database" on trying to add an emoji. 

Though emojis were not so important, Indian language support was required.

On checking the collations, found that the db used
Default Charset = utf8 and 
Default Collation = utf8_general_ci
just like another test site of ours, and that copy-pasting Indian language text was working - 

நமது தளத்தில் தமிழைச் சோதிக்கவே இந்த உரை.
यह पाठ हमारी साइट में हिंदी का परीक्षण करने के लिए है।
ഈ വാചകം ഞങ്ങളുടെ സൈറ്റിൽ മലയാളം പരീക്ഷിക്കുന്നതിനുള്ളതാണ്.
ಈ ಪಠ್ಯವು ನಮ್ಮ ಸೈಟ್‌ನಲ್ಲಿ ಕನ್ನಡವನ್ನು ಪರೀಕ್ಷಿಸಲು.
ఈ వచనం మన సైట్‌లో తెలుగును పరీక్షించడానికి.

(Made with translate.google.com )

So I did not change the collation to utf8mb4_unicode_ci as suggested in the Moodle documentation in the link at the beginning of this post, since this is a potentially dangerous operation, and can take a long time and can break things, so I would need to take precautions like making a backup, a rollback plan and so on. 

No comments:

Post a Comment