Discover Centmin Mod today
Register Now

Beta Branch add SET_DEFAULT_MYSQLCHARSET variable in 123.09beta01

Discussion in 'Centmin Mod Github Commits' started by eva2000, Jul 16, 2019.

  1. eva2000

    eva2000 Administrator Staff Member

    55,400
    12,255
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,835
    Local Time:
    2:53 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    add SET_DEFAULT_MYSQLCHARSET variable in 123.09beta01


    If you set SET_DEFAULT_MYSQLCHARSET='utf8mb4' in persistent config file /etc/centminmod/custom_config.inc prior to initial Centmin Mod install, it allows changing MariaDB MySQL /etc/my.cnf default characterset & collation from utf8 defaults to utf8mb4 defaults for both MySQL client and server.

    Continue reading...

    123.09beta01 branch
     
  2. EckyBrazzz

    EckyBrazzz Active Member

    917
    190
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +363
    Local Time:
    1:53 PM
    Latest
    Latest
  3. eva2000

    eva2000 Administrator Staff Member

    55,400
    12,255
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,835
    Local Time:
    2:53 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    It was originally intended for when you have web apps with mysql databases created with utf8mb4 character set and collation so that default mysqldump backups end up backing up data as utf8mb4 instead of mysql default uft8 - otherwise data can be corrupted i.e. xenforo emojis need utf8mb4 to work. See Public service announcement: Check your MySQL backup! and my reply at Public service announcement: Check your MySQL backup!

    Or if you have mix of database character set and collations other than utf8mb4 and utf8, then you'd need use mysqldump with --default-character-set=utf8mb4 where mysql database is utf8mb4 and the intended characterset is the one your database is i.e. uft8mb4

    Your mysql backup scripts would also need adjusting to correct mysql database characterset if your mysql server i.e. MariaDB server is of one character set default - on Centmin Mod that is utf8 or non-Centmin Mod MariaDB is latin1 characterset and your database is utf8mb4

    dbbackup.sh smarter mysql backups



    Centmin Mod premium members dbbackup.sh mysql backup script has conditional mysql database characterset detection so it backups up your database according to the characterset of the database detected MariaDB - dbbackup.sh - quick mysql database backups for Centmin Mod stack. One of the features of dbbackup.sh = Smarter per database character set and collation handling for backups to prevent database table corruption due to character set and mixed collations.

    changing default characterset/collations



    If all your mysql databases are utf8 character set based or non-utf8mb4 based, then Centmin Mod's MariaDB default utf8 characterset should suffice. If any of your mysql databases are only utf8mb4, then MariaDB server may need utf8mb4 defaults which can be set via 1st post persistent variable for initial Centmin Mod installs or you can change it manually in /etc/my.cnf on existing installs - which only affect new mysql databases created from the time of the /etc/my.cnf change of default characterset. Existing mysql databases won't change characterset/collations unless you manually convert your databases and database tables' characterset and collation at database, table and column/field levels.
     
  4. EckyBrazzz

    EckyBrazzz Active Member

    917
    190
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +363
    Local Time:
    1:53 PM
    Latest
    Latest
    Thx, for me no need to change it as I only have WP sites and a bunch others with utf8 character. So no performance gain or so.