0

I had a MariaDB schema which was using utf8_general_ci. I noticed that when I tried entering russion text, characters were being changed to question marks (?).

I therefore changed the collations to utf8_unicode_ci and this worked on my local machine. However, when I exported the schema with the new collation and ran it over on my Amazon EC2 instance, characters are still being changed to question marks.

I verified that these schemas are exactly the same since on EC2 I dropped the DB and recreated it after exporting my local SQL schema (with the new collation).

I can't figure out why this is working on my local machine but no on EC2. Any ideas?

seedg
  • 21,692
  • 10
  • 42
  • 59
  • `utf_general_ci`.? you mean `utf8_general_ci`. – Raymond Nijland May 20 '18 at 12:01
  • You sure the application code/ SQL program you connect with is using the utf8 charset? – Raymond Nijland May 20 '18 at 12:03
  • @RaymondNijland yes, edited the post. Sorry about that – seedg May 20 '18 at 12:06
  • @raymond I am using asp.net mvc and the only difference is that on the live server, it is the published version. Maybe there is a configuration which I might be missing while deploying? – seedg May 20 '18 at 12:44
  • 1
    Use `SELECT HEX(column)` to dump out the values of a few rows in your local and aws databases that supposedly contain the same Russian words. Comparing the hex values of the strings will tell you whether the correct Unicode characters are present in both databases. If they are, then you're retrieving and displaying them wrongly. If they are not, then you're inserting them wrongly. See this: https://stackoverflow.com/questions/1385994/read-write-unicode-data-in-mysql . Also, do SHOW CREATE TABLE on both servers, and make sure the character set definitions are the same. – O. Jones May 20 '18 at 13:57
  • See 'question marks' in https://stackoverflow.com/questions/38363566/trouble-with-utf8-characters-what-i-see-is-not-what-i-stored – Rick James May 22 '18 at 21:50

0 Answers0