From 930563ce0d47dfb80b8298df883030bd3694198b Mon Sep 17 00:00:00 2001 From: Javier Sánchez Parra Date: Wed, 1 Apr 2020 13:53:27 +0200 Subject: #941 Set MySQL encoding to UTF-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit sets the MySQL enconding to UTF8. This way we can avoid problems with special characters in strings, like: ó. It also changes the installation script to always copy the MySQL configuration template and restart MySQL. So, even if the server had MySQL installed before the OpenGnsys installation, the script configures MySQL. Example error that this commit should fix: ogAdmServer[12524]: failed to query database (actualizaSoftware:2380) 1366: Incorrect string value: '\xF3n de ...' for column 'descripcion' at row 1 The encoding configuration before this commit should be like this: mysql> 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/ | +--------------------------+----------------------------+ 8 rows in set (0.10 sec) The encoding configuration after this commit should be like this: mysql> SHOW VARIABLES LIKE 'char%'; +--------------------------+----------------------------+ | Variable_name | Value | +--------------------------+----------------------------+ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | +--------------------------+----------------------------+ 8 rows in set (0.01 sec) --- server/etc/mysqld-og.cnf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'server') diff --git a/server/etc/mysqld-og.cnf b/server/etc/mysqld-og.cnf index b7ea14c0..36641c65 100644 --- a/server/etc/mysqld-og.cnf +++ b/server/etc/mysqld-og.cnf @@ -1,3 +1,4 @@ [mysqld] event_scheduler = ON - +character-set-server=utf8 +collation-server=utf8_general_ci -- cgit v1.2.3-18-g5258