0

I'm trying to create a table in a SQL database with Russian words and English definitions. I know this looks like a repeat question but I've gone through the answers I've been able to find here on StackOverflow and on this page and I can't seem to get them to work for me. I'm using MariaDB and trying to insert data into my table via the command line. The most recent thing I've tried to do is this:

ALTER TABLE my_table CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;

Then added another definition to it to see if it would print the Cyrillic but it doesn't. If my input is:

insert into table my_table('финик','The sweet, edible, oblong or oval fruit of the date palm, containing a narrow, hard seed.');

And I do a select * statement, the output will be:

????? - The sweet, edible, oblong or oval fruit of the date palm, containing a narrow, hard seed.

I've also tried to change the default character set and default collation in the db.txt file in my database folder but nada.

I feel like there's something super obvious I'm missing. Thank you so much for reading.

Phil Dukhov
  • 67,741
  • 15
  • 184
  • 220
  • Does this answer your question? [UTF-8 all the way through](https://stackoverflow.com/questions/279170/utf-8-all-the-way-through) – Paul T. Dec 12 '20 at 01:19
  • See 'question mark' in https://stackoverflow.com/questions/38363566/trouble-with-utf8-characters-what-i-see-is-not-what-i-stored Probably the problem is with specifying the _client_ character set. – Rick James Dec 12 '20 at 01:27
  • @Paul @Rick Sorry for not responding sooner, I've been trying to figure this out and am still having trouble... the links, although informative, didn't seem to solve my issue. The charset of my table is utf8mb4 and collation is utf8mb4_unicode_ci. I've changed the collation of the columns to utf8mb4_unicode_ci and am trying to set the charset to utf8mb4 with `ALTER TABLE table_name MODIFY column NVARCHAR(50) CHARACTER SET utf8mb4;` but it keeps telling me I have a syntax error. -_- Maybe I'll have an easier time using a SQL program that is not MariaDB. Thank you both for your responses. – glitter_magnolia Dec 15 '20 at 19:30
  • What is your DB version? ... I don't think `NVARCHAR` was available until v10.2? Also, it may help to show the full syntax error message. – Paul T. Dec 16 '20 at 12:58
  • It looks like I have MariaDB 10.5 (so it says at the top of my command line, MariaDB 10.5 (x64)). Here's my full error message: ```You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'character set utf8mb4' at line 1 ``` – glitter_magnolia Dec 16 '20 at 13:23

0 Answers0