[Koha] [Koha-devel] Character sets in MariaDB 10.5

Michael Kuhn mik at adminkuhn.ch
Fri Aug 27 00:31:48 NZST 2021


Hi Tomas

Today you wrote:

 > Those are just defaults in the OS distribution, that can be changed at
 > will.
 >
 > Koha, internally, sets the character set correctly on connection time
 > [1].
 >
 > You should always check when they drop support for our used encodings.
 > Which is not the case (for now?). We have the test suite run against
 > the latest versions of MariaDB for that purpose.
 >
 > I recommend you set that defaults correctly so they are picked when
 > you use the CLI.

I have now added the following line in both files 
"/etc/mysql/mariadb.conf.d/50-client.cnf" /section [client]) and 
"/etc/mysql/mariadb.conf.d/50-mysql-clients.cnf" (section [mysql]):

default-character-set = utf8mb4

Now as in Debian 9 and 10 the character sets in MariaDB running on 
Debian 11 look as follows:

MariaDB [(none)]> SHOW VARIABLES LIKE 'character_set_%';
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8mb4                    |
| character_set_connection | utf8mb4                    |
| character_set_database   | utf8mb4                    |
| character_set_filesystem | binary                     |
| character_set_results    | utf8mb4                    |
| character_set_server     | utf8mb4                    |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+

Thank you very much for your recommendation!

Best wishes: Michael
-- 
Geschäftsführer · Diplombibliothekar BBS, Informatiker eidg. Fachausweis
Admin Kuhn GmbH · Pappelstrasse 20 · 4123 Allschwil · Schweiz
T 0041 (0)61 261 55 61 · E mik at adminkuhn.ch · W www.adminkuhn.ch




> El mié., 25 ago. 2021 17:54, Michael Kuhn <mik at adminkuhn.ch 
> <mailto:mik at adminkuhn.ch>> escribió:
> 
>     Hi
> 
>     1. In the last few years when installing Koha on Debian GNU/Linux 9 or
>     10 the character sets in MariaDB were as follows:
> 
>     MariaDB [(none)]> SHOW VARIABLES LIKE '%char%';
>     +--------------------------+----------------------------+
>     | Variable_name            | Value                      |
>     +--------------------------+----------------------------+
>     | character_set_client     | utf8mb4                    |
>     | character_set_connection | utf8mb4                    |
>     | character_set_database   | utf8mb4                    |
>     | character_set_filesystem | binary                     |
>     | character_set_results    | utf8mb4                    |
>     | character_set_server     | utf8mb4                    |
>     | character_set_system     | utf8                       |
>     | character_sets_dir       | /usr/share/mysql/charsets/ |
>     +--------------------------+----------------------------+
> 
>     Today I installed Koha 21.05.03 on Debian GNU/Linux 11 with MariaDB
>     10.5.11 where the character sets are as follows:
> 
>     MariaDB [(none)]> SHOW VARIABLES LIKE '%char%';
>     +--------------------------+----------------------------+
>     | Variable_name            | Value                      |
>     +--------------------------+----------------------------+
>     | character_set_client     | utf8                       |
>     | character_set_connection | utf8                       |
>     | character_set_database   | utf8mb4                    |
>     | character_set_filesystem | binary                     |
>     | character_set_results    | utf8                       |
>     | character_set_server     | utf8mb4                    |
>     | character_set_system     | utf8                       |
>     | character_sets_dir       | /usr/share/mysql/charsets/ |
>     +--------------------------+----------------------------+
> 
>     I'm not sure what is going on here. Does anyone know why the character
>     sets for client, connection and results have changed from utf8mb4 to
>     utf8? Is this correct with Koha or should these character sets be
>     changed?
> 
>     2. Today I came upon an installation of Koha 18.11.05 using MariaDB
>     10.0.32 which has the following character sets:
> 
>     MariaDB [(none)]> SHOW VARIABLES LIKE '%char%';
>     +--------------------------+----------------------------+
>     | Variable_name            | Value                      |
>     +--------------------------+----------------------------+
>     | character_set_client     | utf8                       |
>     | character_set_connection | utf8                       |
>     | character_set_database   | latin1                     |
>     | character_set_filesystem | binary                     |
>     | character_set_results    | utf8                       |
>     | character_set_server     | latin1                     |
>     | character_set_system     | utf8                       |
>     | character_sets_dir       | /usr/share/mysql/charsets/ |
>     +--------------------------+----------------------------+
> 
>     This seems quite wrong to me - as far as I know "latin1" was never a
>     supported character set in Koha... as far as I know the character sets
>     should be set as shown in topic 1.
> 
>     However, is it still possible to update such a database with these
>     character sets to Koha 21.05.03 without destroying the data completely?
> 
>     Best wishes: Michael
>     -- 
>     Geschäftsführer · Diplombibliothekar BBS, Informatiker eidg. Fachausweis
>     Admin Kuhn GmbH · Pappelstrasse 20 · 4123 Allschwil · Schweiz
>     T 0041 (0)61 261 55 61 · E mik at adminkuhn.ch
>     <mailto:mik at adminkuhn.ch> · W www.adminkuhn.ch <http://www.adminkuhn.ch>
>     _______________________________________________
>     Koha-devel mailing list
>     Koha-devel at lists.koha-community.org
>     <mailto:Koha-devel at lists.koha-community.org>
>     https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
>     <https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel>
>     website : https://www.koha-community.org/
>     <https://www.koha-community.org/>
>     git : https://git.koha-community.org/ <https://git.koha-community.org/>
>     bugs : https://bugs.koha-community.org/
>     <https://bugs.koha-community.org/>
> 




More information about the Koha mailing list