[debian-mysql] Bug#933063: character_set_client: latin1?
Olaf van der Spek
olafvdspek at gmail.com
Fri Jul 26 11:18:29 BST 2019
Package: libmariadb-dev-compat
Version: 1:10.3.15-1
Severity: normal
Dear Maintainer,
I expected character_set_client to be utf8mb4, but it's latin1. Isn't it supposed to be utf8mb4?
Greetings,
Olaf
/etc/mysql/mariadb.conf.d/50-client.cnf :
[client]
# Default is Latin1, if you need UTF-8 set this (also in server section)
default-character-set = utf8mb4
Output:
character_set_client: latin1
character_set_connection: latin1
character_set_database: utf8mb4
character_set_filesystem: binary
character_set_results: latin1
character_set_server: utf8mb4
character_set_system: utf8
character_sets_dir: /usr/share/mysql/charsets/
#include <iostream>
#include <mysql/mysql.h>
#include <stdexcept>
int main()
{
MYSQL h;
if (!mysql_init(&h)
|| mysql_options(&h, MYSQL_READ_DEFAULT_GROUP, "")
// || mysql_options(&h, MYSQL_SET_CHARSET_NAME, "utf8mb4")
|| !mysql_real_connect(&h, "", "", NULL, "", 0, NULL, 0))
throw std::runtime_error(mysql_error(&h));
std::string q = "show variables like '%char%'";
if (mysql_real_query(&h, q.data(), q.size()))
throw std::runtime_error(mysql_error(&h));
MYSQL_RES* result = mysql_store_result(&h);
if (!result && mysql_errno(&h))
throw std::runtime_error(mysql_error(&h));
while (MYSQL_ROW row = mysql_fetch_row(result))
{
std::cout << row[0] << ": " << row[1] << "\n";
}
return 0;
}
-- System Information:
Debian Release: 10.0
APT prefers stable
APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 4.19.0-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages libmariadb-dev-compat depends on:
ii libmariadb-dev 1:10.3.15-1
libmariadb-dev-compat recommends no packages.
libmariadb-dev-compat suggests no packages.
-- no debconf information
More information about the pkg-mysql-maint
mailing list