change mysql default charset

mahdy_sharifi

Well-Known Member
Feb 26, 2012
220
1
68
cPanel Access Level
Root Administrator
our Mysql server hosted over 50 database and 100 G disk , Is it safe changing Mysql Server default charset to utf8mb4 ? maybe user website break due this change ?

Thanks
 

mahdy_sharifi

Well-Known Member
Feb 26, 2012
220
1
68
cPanel Access Level
Root Administrator
my question not related How can do this . I want know is this changing safe for existing database like User database , Cpanel database (horde , mysql , roundcube ... ) ?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,908
2,218
463
Hello,

Changing the default MySQL character set for the server only affects new databases created after the change. Existing databases are not affected unless you alter their character sets. You can review MySQL documentation on this topic for more information on how this works:

MySQL :: MySQL 5.6 Reference Manual :: 10.5 Character Set Configuration
MySQL :: MySQL 5.6 Reference Manual :: 10.1.3.3 Database Character Set and Collation

MariaDB also provides a useful document if you plan to switch to MariaDB in the future:

Setting Character Sets and Collations

Thank you.