I would like to use utf8mb4 charset, but I'm not sure magento support it or not. I worry about index size. Anyone using utf8mb4 in production now?
Thank you.
Hi,
yes it does. My installation (2.4.1) works like a charm!
Do you have all of your tables using it or just specific ones?
Mine crashed during bin/magento setup:upgrade with the following error
SQLSTATE[HY000]: General error: 1283 Column 'content' cannot be part of FULLTEXT index, query was: ALTER TABLE `cms_block` MODIFY COLUMN `content` mediumtext NULL COMMENT "Block Content", DEFAULT CHARSET='utf8', DEFAULT COLLATE='utf8_general_ci'
So in my opinion magento 2.4.5 is not compatible with utf8mb4
Ok, thanks for letting me know it.
Yes, Magento 2.4 does support the utf8mb4 character set. Starting from Magento 2.4.0, the database character set and collation are set to utf8mb4 by default. This character set supports a wider range of characters, including emoji, and is recommended for use with Magento.
However, note that using utf8mb4 may increase the size of your database indexes. This is because utf8mb4 uses more bytes to store characters compared to the default utf8 character set. This may lead to performance issues on databases with a large number of records.
To optimize your database for utf8mb4, you can use the MySQL "innodb_large_prefix" option. This allows for larger index keys and can help reduce the impact of the larger character set on index size. Additionally, you can consider using a database clustering solution to distribute the load across multiple servers.
Overall, utf8mb4 is widely used in production environments and is recommended for use with Magento 2.4. If you are concerned about performance, there are several optimization techniques you can use to mitigate any potential issues.
As you can see, Magento 2.4.6 default charset is utf8mb3 NOT utf8mb4.
So if you use utf8mb4 then your site is broken.
Magento is not supported utf8mb4.