Database error when adding a User

Re: Database error when adding a User

by Leon Stringer -
Number of replies: 0
Picture of Core developers Picture of Particularly helpful Moodlers

It looks like $CFG->dboptions['dbcollation'] in config.php is utf8_bin. Hopefully you just need to change this to utf8mb4_unicode_ci:

$CFG->dboptions = array (
  ⋮
  'dbcollation' => 'utf8mb4_unicode_ci',
);

There are two character set/collation combinations Moodle supports with MySQL (and MariaDB):

  1. character set utf8mb4 with collation utf8mb4_unicode_ci. This is the recommended setting supporting the full Unicode character set but some servers still don't support the larger index size this needs in which case they must use:
  2. character set utf8 with collation utf8_unicode_ci. This works but has some restrictions, notably that trying to use emojis will result in a database error.
Average of ratings: Useful (1)