I'm trying to insert this text via SQL query
INSERT INTO `tbl_instructions` (`No`, `Language`, `Text`) VALUES
('Introduction','HU','Kérdőív - ""Ismerd meg Önmagad!"" Ahogy az ókori görögök mondták: ""Ismerd meg Önmagad!"" - Ez a célja ennek a személyiségtesztnek is. Ez a teszt egy negyedórás szemtől szembeni beszélgetésnek felel meg. A teszt kitöltése nagyjából fél órát igényel. Közben megszakíthatja az internetkapcsolatot, elég a teszt elküldéséhez visszaállítania azt. Jó szórakozást kívánunk a teszthez, természetesen az adatait bizalmasan kezeljük és nem osztjuk meg senkivel. Ezt garantálja Andreas és Telse Gross');
and I'm getting:
#1366 - Incorrect string value: '\xC5\x91\xC3\xADv ...' for column my_database.tbl_instructions.Text at row 1
I tried utf8_unicode_ci
and UTf8mb4_unicode_ci
and I'm still getting the same error.
This is likely to be a collation issue with the
Text
column in the target table.Consider the following, which uses a
Text
column created with thelatin1_general_ci
collation:This produces the following error:
Now consider the following, that uses
utf8mb4_0900_ai_ci
:This runs successfully.
Simply specifying the collation on
INSERT
is not good enough - if the target column is an incompatible collation then you will get the error message you are seeing.The table should be modified to be the correct collation - I am not suggesting it should be
utf8mb4_0900_ai_ci
. Use the collation that is appropriate for your needs (for example,latin2_general_ci
also works for your character set).Update following OP changing RDBMS to MariaDB instead of MySQL
Following your comment about using MariaDB instead of MySQL, you could use
utf8mb4_general_ci
which is available in MariaDB 10.2.Here's a working fiddle for MariaDB 10.3 showing it working using that collation.