Join the community today
Become a Member

Beta Branch update my.cnf templates to default to utf8 instead of latin1 in 123.0…

Discussion in 'Centmin Mod Github Commits' started by eva2000, Sep 16, 2016.

  1. eva2000

    eva2000 Administrator Staff Member

    55,425
    12,257
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,840
    Local Time:
    3:47 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    update my.cnf templates to default to utf8 instead of latin1 in 123.09beta01

    For fresh 123.09beta01 installs MariaDB 10.1 now use my.cnf templates which default to utf8 instead of latin1 for each use by folks starting out on Centmin Mod LEMP stacks. Changing charset and collations of MariaDB MySQL is outlined at MariaDB MySQL - CentminMod.com LEMP Nginx web stack for CentOS for server side.

    Continue reading...


    123.09beta01 branch
     
    Last edited: Sep 16, 2016
  2. pamamolf

    pamamolf Well-Known Member

    4,101
    428
    83
    May 31, 2014
    Ratings:
    +838
    Local Time:
    8:47 PM
    Nginx-1.26.x
    MariaDB 10.6.x
    Just a note for this:

    If a user has already a database that is not utf8 and edit the my.cnf file to add that edit then all characters will break on site .....

    At least for me that was the case.... but i think for new sites having that option from start will be ok....

    Don't know how it will be if a user use phpmyadmin to create a database that is not a utf8 after that edit ..... ?
     
  3. eva2000

    eva2000 Administrator Staff Member

    55,425
    12,257
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,840
    Local Time:
    3:47 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    that's why it's only set to default to utf8 on fresh centmin mod installs.. if user uses mysqldump of sql file from old server and imports to new utf8 default server should be okay depending on what data is being imported

    phpmyadmin users whatever is mysql server default charset and collations.
     
  4. eva2000

    eva2000 Administrator Staff Member

    55,425
    12,257
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,840
    Local Time:
    3:47 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  5. pamamolf

    pamamolf Well-Known Member

    4,101
    428
    83
    May 31, 2014
    Ratings:
    +838
    Local Time:
    8:47 PM
    Nginx-1.26.x
    MariaDB 10.6.x
    What's the issue with it?

    For me it was ok....

    I just create a database and it was utf8 with no errors.

    How can i do it manually now? :(
     
    Last edited: Sep 21, 2016
  6. eva2000

    eva2000 Administrator Staff Member

    55,425
    12,257
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,840
    Local Time:
    3:47 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    the mysql client errors out on SSH command line. So could be just an issue with [mysql] group set one and not [client] as it seems from help command mysql client doesn't support it in MariaDB and [client] group doesn't need it as it autos to what system/server is set to.
     
  7. pamamolf

    pamamolf Well-Known Member

    4,101
    428
    83
    May 31, 2014
    Ratings:
    +838
    Local Time:
    8:47 PM
    Nginx-1.26.x
    MariaDB 10.6.x
    Which setting is for this one?

    Damn i thought that i just solve the issue to not use phpmyadmin....

    But now i will not be sure if the mysqladmin create for me a utf8 database for me :(
     
  8. eva2000

    eva2000 Administrator Staff Member

    55,425
    12,257
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,840
    Local Time:
    3:47 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    what ever character_set_server / character_set_client is set to as outlined at MariaDB MySQL - CentminMod.com LEMP Nginx web stack for CentOS and Setting Character Sets and Collations - MariaDB Knowledge Base (though that article lists default-character-set=utf8 as valid for [mysql] group but mariadb 10.1 didn't like it for my tests hence reversed that change)
     
    Last edited: Sep 21, 2016
  9. pamamolf

    pamamolf Well-Known Member

    4,101
    428
    83
    May 31, 2014
    Ratings:
    +838
    Local Time:
    8:47 PM
    Nginx-1.26.x
    MariaDB 10.6.x
    So the only way to create a new database with utf8 is to use phpmyadmin?
     
  10. eva2000

    eva2000 Administrator Staff Member

    55,425
    12,257
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,840
    Local Time:
    3:47 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    no.. once mysql is set to default to utf8 as outlined at MariaDB MySQL - CentminMod.com LEMP Nginx web stack for CentOS any mysql database created will default to utf8 regardless of how it's created i.e. via SSH command line or via phpmyadmin etc. Unless you use a php web app script and it installs and creates a mysql database with specifically set character set and collation of it's own as outlined at Setting Character Sets and Collations - MariaDB Knowledge Base
     
  11. pamamolf

    pamamolf Well-Known Member

    4,101
    428
    83
    May 31, 2014
    Ratings:
    +838
    Local Time:
    8:47 PM
    Nginx-1.26.x
    MariaDB 10.6.x
    Ok found it:

    but i thought that you told above that you revert this one... :(

    Post #4
     
  12. eva2000

    eva2000 Administrator Staff Member

    55,425
    12,257
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,840
    Local Time:
    3:47 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    reverted for [mysql] not [mysqld] ;)
     
  13. pamamolf

    pamamolf Well-Known Member

    4,101
    428
    83
    May 31, 2014
    Ratings:
    +838
    Local Time:
    8:47 PM
    Nginx-1.26.x
    MariaDB 10.6.x
    Just to verify i should have it only at mysqld and not at mysql or client... correct?
     
  14. eva2000

    eva2000 Administrator Staff Member

    55,425
    12,257
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,840
    Local Time:
    3:47 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    yup
     
  15. RB1

    RB1 Active Member

    292
    75
    28
    Nov 11, 2016
    California
    Ratings:
    +122
    Local Time:
    10:47 AM
    Nginx 1.21.x
    MariaDB 10.1.x
    Can you change character set for just one database?
    For example I have utf8 as the default but I want a certain database to be latin1
     
  16. eva2000

    eva2000 Administrator Staff Member

    55,425
    12,257
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,840
    Local Time:
    3:47 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    not via my.cnf, you do it via mysql database creation routine whether it is via php script you're installing, phpmyadmin set etc. But why latin1 ? any db with UTF8 works fine usually with latin1 anyway.
     
  17. RB1

    RB1 Active Member

    292
    75
    28
    Nov 11, 2016
    California
    Ratings:
    +122
    Local Time:
    10:47 AM
    Nginx 1.21.x
    MariaDB 10.1.x
    Yeah it's a PHP script.
    Well, I'm having some issue with my database and the software developer told me to try latin1.
    On utf8 I get the error about it exceeding 767 bytes (InnoDB) and utf8mb4 via my.cnf gives some other weird error in the software.
     
  18. eva2000

    eva2000 Administrator Staff Member

    55,425
    12,257
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,840
    Local Time:
    3:47 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  19. RB1

    RB1 Active Member

    292
    75
    28
    Nov 11, 2016
    California
    Ratings:
    +122
    Local Time:
    10:47 AM
    Nginx 1.21.x
    MariaDB 10.1.x
  20. RB1

    RB1 Active Member

    292
    75
    28
    Nov 11, 2016
    California
    Ratings:
    +122
    Local Time:
    10:47 AM
    Nginx 1.21.x
    MariaDB 10.1.x