I’m running into a weird issue with MySQL 8 installation on my cloud server. The setup process automatically configures the database to use utf8mb3 encoding instead of the standard utf8mb4 that should be the default. I’ve looked through all the installation options but can’t seem to find any settings to control the character encoding during setup. Has anyone figured out how to make the installer stick with utf8mb4 as the character set? I really don’t want to have to manually change this after installation since it might cause issues with existing data. Any suggestions on installation flags or config files that might help with this?
make sure ur my.cnf is set up right b4 the install. add character-set-server=utf8mb4 and collation-server=utf8mb4_unicode_ci there. helped me fix this issue when i was using centos last month.
I encountered something similar when deploying MySQL 8 on AWS instances. The issue often stems from the initialization script detecting system locale settings incorrectly. What worked for me was passing the character set parameters directly during the mysqld initialization phase. Try running mysqld with --initialize-insecure --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci flags before starting the service properly. You might also want to check if your distribution’s MySQL package has any custom defaults that override the standard configuration. Some cloud providers ship modified versions that revert to older encoding standards for compatibility reasons. If you’re using Docker or containerized deployment, make sure the base image isn’t forcing utf8mb3 through environment variables.
Had this exact problem with MySQL 8.0.28 on Ubuntu Server last year. The root cause was that the installer reads system-wide locale configuration during setup and sometimes defaults to utf8mb3 for backward compatibility. What solved it for me was creating a custom configuration file at /etc/mysql/conf.d/charset.cnf before running the installation. Inside the file I specified [mysqld] section with character-set-server=utf8mb4 and default-table-options=‘charset=utf8mb4’. The key is having this configuration present before the initial database creation happens, not after. Also worth checking if your package manager is pulling an older MySQL repository that still has utf8mb3 as default - some distros lag behind on this. You can verify which repo you’re using with apt-cache policy mysql-server on Debian-based systems.