0) Requirements
1. Developer is surely needed to test this.
2. MySQL 8 up and running, can use docker image easily.
3. Be able to run manual SQL commands against that MySQL 8 instance.
4. Ability to modify some PHP scripts.
1) Setting up
1 Set up a server with MySQL 8.0.2 or greater as the Moodle database.
2. Create the Moodle database using the utf8 character set and utf8_unicode_ci default collation, e.g.:
CREATE DATABASE `mdl70181.test` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
|
CREATE USER 'mdl70181.test'@'localhost' IDENTIFIED BY 'yourpassword';
|
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON `mdl70181.test`.* TO 'mdl70181.test'@'localhost';
|
3. Install Moodle pointing to the created database, either via the web interface or command line ensuring that the database table 'prefix' setting is set to blank (not 'mdl_').
2) mysql_collation.php tests
1. After installation has completed, run the script to migrate to the utf8mb4 character set:
php admin/cli/mysql_collation.php --collation=utf8mb4_unicode_ci
|
2. Verify that there aren't errors. Example last five lines tested with Moodle 3.9:
...
|
...
|
workshopform_rubric_config - CONVERTED
|
layout - NO CHANGE
|
workshopform_rubric_levels - CONVERTED
|
definition - NO CHANGE
|
|
Converted: 428, skipped: 1119, errors: 0
|
3) mysql_compressed_rows.php
0. Note: The following 2 steps are to force the system to detect the groups table to require fixing.
1. Connect to the MySQL from client and execute this SQL command:
ALTER TABLE `groups` row_format = compact;
|
COMMIT;
|
2. Edit the admin/cli/mysql_compressed_rows.ph y change the THREE occurrences of:
if ($size <= $generator::ANTELOPE_MAX_ROW_SIZE) {
|
to:
if ($size <= $generator::ANTELOPE_MAX_ROW_SIZE && $table != 'groups') {
|
3. Run the CLI script:
$ php admin/cli/mysql_compressed_rows.php --list
|
4. Verify that, apart from other tables... the "groups" one is shown as follows:
groups Compact (needs fixing)
|
5. Run the CLI script:
php admin/cli/mysql_compressed_rows.php --showsql
|
6. Verify that the suggested SQL to execute, include the groups table (with back-ticks) like this:
ALTER TABLE `groups` ROW_FORMAT=Compressed;
|
7. Execute the the SQL shown in the previous step in the MySQL client.
8. Run again the cli script as it was in step 3.
$ php admin/cli/mysql_compressed_rows.php --list
|
9. Verify that the groups table is listed, but it now shows the "Compressed" format and it does not say "(needs fixing)" anymore.
Note, we cannot use the --fix option of the CLI, because it uses some MySQL parameters not available in MySQL 8 anymore. MDL-71512 has been created to fix that.