Bug #96335 MySQL doesn't start when I set default_collation_for_utf8mb4 in my.cnf
Submitted: 26 Jul 4:47 Modified: 26 Jul 12:28
Reporter: Tomoaki Otsuka Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:8.0.16, 8.0.17 OS:CentOS (7.6)
Assigned to: CPU Architecture:x86

[26 Jul 4:47] Tomoaki Otsuka
Description:
I can't start MySQL when I set default_collation_for_utf8mb4 in my.cnf.

The error message is below.
[ERROR] [MY-000067] [Server] unknown variable 'default_collation_for_utf8mb4=utf8mb4_general_ci'.

According to server-option-variable-reference (https://dev.mysql.com/doc/refman/8.0/en/server-option-variable-reference.html ) "Option File" for default_collation_for_utf8mb4 is set to "Yes".

How to repeat:
Add "default_collation_for_utf8mb4=utf8mb4_general_ci" to  my.cnf and restart mysqld.

Suggested fix:
I don't know this is a bug or documentation error, but I think it's needed to correct eigher.
[26 Jul 4:52] Tomoaki Otsuka
- Change more specific category
- Add more information about OS, CPU Architecture
[26 Jul 6:30] Umesh Shastry
Hello!

Thank you for the report.
Imho this sounds like documentation bug to me since this system variable can only be dynamically set at runtime using the SET statement and not by Cmd-Line or Option File as shown in the documentation.

- Checked 8.0.11/8.0.17
mysql> show variables like 'default_collation_for_utf8mb4';
+-------------------------------+--------------------+
| Variable_name                 | Value              |
+-------------------------------+--------------------+
| default_collation_for_utf8mb4 | utf8mb4_0900_ai_ci |
+-------------------------------+--------------------+
1 row in set (0.01 sec)

mysql> show global variables like 'default_collation_for_utf8mb4';
+-------------------------------+--------------------+
| Variable_name                 | Value              |
+-------------------------------+--------------------+
| default_collation_for_utf8mb4 | utf8mb4_0900_ai_ci |
+-------------------------------+--------------------+
1 row in set (0.01 sec)

mysql> set default_collation_for_utf8mb4=utf8mb4_general_ci;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> set global default_collation_for_utf8mb4=utf8mb4_general_ci;
Query OK, 0 rows affected, 1 warning (0.00 sec)

But any attempt to set via Cmd-Line or Option File results in "[ERROR] [MY-000067] [Server] unknown variable 'default_collation_for_utf8mb4=utf8mb4_general_ci'."

regards,
Umesh
[26 Jul 6:31] Umesh Shastry
https://dev.mysql.com/doc/refman/8.0/en/server-option-variable-reference.html

Attachment: 96335.png (image/png, text), 16.25 KiB.

[26 Jul 12:28] Paul Dubois
Posted by developer:
 
This is a doc bug, it cannot be set in my.cnf. Thanks for pointing that out, will correct it.