Score:0

MariaDB: Problems with UTF-8 characters after migrating to a new server

cg flag

I have migrated to another server many times but never had this problem. None of the possible solutions work and utf-8 characters appear incorrectly in PHP-FPM.

What I tried:

ALTER DATABASE database2 CHARACTER SET utf8;

Edited my.conf file and added lines:

[mysqld]
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8

Tried to change charsets for the database, tables - absolutely no effect.

And of course I have <meta http-equiv="content-type" content="text/html; charset=UTF-8"> in <head>

Restarted mysql, mysqld after making changes. But I see absolutely no change and utf-8 characters still appear incorrectly. Utf-8 characters of the old records appear incorrectly in all cases. In the new entries, for example, Spanish characters appear correctly, but Czech, Latvian, etc. characters turn into question marks. But of course I need the old records to display correctly as well.

Please see the image

This is old and new server configuration. As you can see there is only 1 difference - server charset, but as I wrote before, changing it has no effect.

Servers old and new

anx avatar
fr flag
anx
Before gathering further diagnostics about of what exactly is in the database - avoid that name in MySQL context. What MySQL used to call `utf8` is a *subset* of UTF-8 (somewhere around 1/3 of characters) thus that name is burned because your software will behave differently based on which compatibility hacks are in place.
ua flag
That's "Mojibake"; see https://stackoverflow.com/questions/38363566/trouble-with-utf8-characters-what-i-see-is-not-what-i-stored As for the things you tried... Changing the Database or Table settings do not impact the Column settings; they merely change the defaults for when you add new Tables or Columns.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.