General developer forum

Is it possible to postpone the MySQL utf8mb4 requirement?

 
Picture of Visvanath Ratnaweera
Is it possible to postpone the MySQL utf8mb4 requirement?
Particularly helpful Moodlers
In recent Moodle versions (from 3.1?) the MySQL utf8mb4 driver has been made a requirement, causing difficulties to those new administrators. Is it possible to make this a only recommendation, not a requirement?

Background: "UTF-8, utf8 and utf8mb4" https://moodle.org/mod/forum/discuss.php?d=362798#p1463659 and the following discussion.
 
Average of ratings: -
Picture of Howard Miller
Re: Is it possible to postpone the MySQL utf8mb4 requirement?
Core developersDocumentation writersParticularly helpful MoodlersPlugin developers

A +1 of sorts

I always thought this was a big ask. It's not a big deal if you have full control of your server (and you have the experience/confidence to make these changes) but it's a whole different matter on hosted services. We've been seeing LOTS of support moans and groans related to this. 

As far as I can see it's not actually critical either. Upgraded sites work fine without it. 

 
Average of ratings: -
Picture of Leon Stringer
Re: Is it possible to postpone the MySQL utf8mb4 requirement?
Particularly helpful Moodlers

The confusion in the original post Visvanath cites arose from the instructions for the Barracuda storage file format requirement as well. So even if it were possible to make utf8mb4 a recommendation instead of a requirement presumably admins would still need to be able to configure the MySQL file format on their server.

 
Average of ratings: -
Picture of Richard Oelmann
Re: Is it possible to postpone the MySQL utf8mb4 requirement?
Core developersParticularly helpful MoodlersPlugin developersTesters

Just noting that in my institution we have experienced issues with text (which has been copied and pasted from another source) which appeared to contain 'hidden' 4byte characters, so although it may be complex, we will be doing this change before our next major upgrade - I've already done it on my development and test environments, but not yet on the live one.

 
Average of ratings: -
Picture of Howard Miller
Re: Is it possible to postpone the MySQL utf8mb4 requirement?
Core developersDocumentation writersParticularly helpful MoodlersPlugin developers

I'm not suggesting that the change isn't a good idea. 

However, I'm concerned it's becoming a deal breaker for some users on low-cost hosting.

 
Average of ratings: -
Picture of Adrian Greeve
Re: Is it possible to postpone the MySQL utf8mb4 requirement?
Core developersMoodle HQParticularly helpful MoodlersPlugin developersTesters

Hello Everyone,

There does seem to be some confusion here about utf8mb4. Just to clarify. It is not a requirement of any version of Moodle to use utf8mb4. I'm not sure where this idea has originated from. Perhaps there is some documentation (of which there seems to be a lot) that is misleading? If so, can you please put a comment here and we'll try to track it down and update it.

I worked on the issue and I configured it so that if you begin an installation and your database collation is utf8 (with MySQL or MariaDB) you will see a warning stating that you don't have full UTF-8 support. You are welcome to continue on with your installation. If however you start an installation and your database collation is set to utf8mb4 then other checks will be made that require you to have everything configured correctly.

 
Average of ratings: Useful (5)
Picture of Visvanath Ratnaweera
Re: Is it possible to postpone the MySQL utf8mb4 requirement?
Particularly helpful Moodlers
Hi Adrian

Many thanks for the clarification of the developers' view, i.e. utf8mb4 is _not a requirement_.

Out of the Moodle instances I maintain no production site is beyond 3.1. So I can't say anything about later versions. But I know for sure that during the upgrades (to 3.1) the utf8mb4 kept on nagging, I did the change to MySQL and all went well. Now I am seeing so many problems related to this in the support forums and trying to mediate, to find a correct, standard answer.

I would love to do some test installations on various MySQL/PHP combinations (all Linux). No, in this part of the world we go crazy to finish all the ToDo from the 'last' year and finally, finally have time for reflection during the festive season. wink
 
Average of ratings: -
Picture of Howard Miller
Re: Is it possible to postpone the MySQL utf8mb4 requirement?
Core developersDocumentation writersParticularly helpful MoodlersPlugin developers

It's strange how it seems to be causing so much confusion then.

The 3.3 release notes do rather imply that it is a requirement (it's in the 'requirements' section). This line was dropped from the 3.4 release notes it seems. 

 
Average of ratings: Useful (1)
Picture of Nicolas Martignoni
Re: Is it possible to postpone the MySQL utf8mb4 requirement?
Core developersDocumentation writersParticularly helpful MoodlersPlugin developersTestersTranslators

Yes indeed, this sentence of Moodle 3.3 release notes can be misleading: "If you use MySQL or MariaDB, make sure your database supports full UTF-8 (utf8mb4)".

I've changed it a little bit to clarify the thing, but beware: english is not my first language smile


 
Average of ratings: Useful (2)
Picture of Adrian Greeve
Re: Is it possible to postpone the MySQL utf8mb4 requirement?
Core developersMoodle HQParticularly helpful MoodlersPlugin developersTesters

Thank you for making an update. I've also made a further change to the Moodle 3.3 release notes to make it clear that it is a recommendation rather than a requirement.

 
Average of ratings: -
C'est moi :-)
Re: Is it possible to postpone the MySQL utf8mb4 requirement?
 
Average of ratings: -
Picture of Ken Task
Re: Is it possible to postpone the MySQL utf8mb4 requirement?
Particularly helpful Moodlers

2 cents ...

Is 3.1 still supported for any fixes ... know it's supposed to be supported for
security fixes, but shouldn't fixes include the ability to update the environment
component separately so when a 3.1 Admin user checks environment for future versions
there is no confusion?   Actually, it does allow one to update the component ... which is a fix.

Just tested environment after updating component on a 3.1.highest.
Pick list set to: 3.4 or 3.5 the bottom is displayed a "check" explanation:

And states:

"if this test fails, it indicates a potential problem
The current setup of MySQL or MariaDB is using 'utf8'. This character set does not support four byte characters which include some emoji. Trying to use these characters will result in an error when updating a record, and any information being sent to the database will be lost. Please consider changing your settings to 'utf8mb4'. See the documentation for full details."

"You must solve all the environmental problems (errors) found above before proceeding to install this Moodle version!"

There is a link that goes to:

https://docs.moodle.org/31/en/MySQL_full_unicode_support

The check buttons ... one orange, the other red ... the red one should be
referenced in the last line .... that of 'You must solve ...' (errors - the red check) ...".

Hmmm ... tell 'em, tell 'em what you told them, then tell 'em again!
Yeah, I know redundant but ....

So that means IF something in Moodle attempts to insert an emoji there will
be issues.   Yeah, understand that, but loss of data?

Think that maybe something of more importantance be mentioned ... emoji is one thing
(which really doesn't add any true educational value) ... but Asian characters would be supported ... and if using the BMP plane, mathematical symbols.  Now that's of educational value.

But is there anything in Moodle code or character set for Math that takes advantage of BMP and
math symbols?  Are there math symbols in the BMP plane that could be accessed by Moodle code?

https://dev.mysql.com/doc/refman/5.7/en/charset-unicode.html

Like I said ... 2 cents. ;)

'spirit of sharing', Ken

 
Average of ratings: Useful (1)