Set character_set_system on startup?
I'm running MySQL 8 on AlmaLinux 8.8. My character_set_system is utf8mb3. I want it to be mb4. I guess I have to do this on startup.
Where do I add this to my command service's command line? --default-character-set=utf8mb4. Will default-character-set change the character_set_system to utf8mb4 even if I do this?
eg.
mysql> SHOW VARIABLES WHERE Variable_name LIKE 'character_set_%'...
+--------------------------+--------------------+
| Variable_name | Value |
+--------------------------+--------------------+
| character_set_client | utf8mb4 |
| character_set_connection | utf8mb4 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8mb4 |
| character_set_server | utf8mb4 |
| character_set_system | utf8mb3 |
| collation_connection | utf8mb4_unicode_ci |
| collation_database | utf8mb4_unicode_ci |
| collation_server | utf8mb4_unicode_ci |
+--------------------------+--------------------+
10 rows in set (0.00 sec)
-
Hey there! You would add this to the /etc/my.cnf file, although the formatting will need to be different. You'll use: default-character-set=utf8mb4 in that file, and then restart the MySQL service. 0 -
Hey there! You would add this to the /etc/my.cnf file, although the formatting will need to be different. You'll use: default-character-set=utf8mb4 in that file, and then restart the MySQL service.
well, I don't think thats it. that sets the character_set_server and character_set_client when connecting. I'm sure its good enough, but the character_set_system is different. Its always utf8mb3 for me even know I have this in my.cnf: [client] default-character-set=utf8mb4 [mysql] default-character-set=utf8mb40 -
Thanks for the clarification. I looked at the MySQL documentation and it seems the "character_set_system" value cannot be changed:
ok, thanks!0
Please sign in to leave a comment.
Comments
4 comments