0

Fist of all, I've read this SO post, which is very helpful, too; However, to be 100% sure of that the important data will not be mistakenly changed, I want to ask more specific questions.

Some backgrounds:

  1. My company maintains a running application. It uses mysql and we set the DB on a AWS EC2 instance.
  2. For some reason I go to check the data in the DB directly. I saw the following by run a SELECT command enter image description here
  3. At the cell of 2nd row by column code1, it shows ?????, but it shouldn't be. It should be some Japanese characters.
  4. Below is the output after I run show variables like 'char%'; enter image description here
  5. Another colleague connects to the exactly same EC2 instance and DB. No encoding problem happens. There is no ????? but the correct content.
  6. The output of show variables like 'char%';, on that end, differs from mine by that there are all utf8, no latin1.
  7. The system language of my mac is English, and on the other mac is Japanese.

My questions:

  1. Do the mysql variables differ by each host connecting to the EC2 instance? I thought they are variables for the EC2 instance/the DB (so whoever connects to it should see the same values, but apparently it is not the case)

  2. I guess if I change all the variables to utf8 the encoding problem will disappear. But I don't want to try this casually, given the risk of ruining the data. Will this effect the existing data, if run only SELECT command after that? Do I have to change the variables back to latin1 for the sake of data-integrity?

  3. Given that this is a running application, even if I don't perform some CREATE or UPDATE commands, what if the end users have made some changed, after I change the mysql encoding variables? Will the new data added by the end user have encoding problem?

Lansorian
  • 149
  • 3
  • 11
  • Edit .INI file used by your client, its command line and/or connection properties and set utf8 using. Additionally - look at SHOW CREATE TABLE for your table - I think that the column/table charset is defined as utf8. – Akina Apr 22 '21 at 10:22
  • Does this answer your question? [UTF-8 all the way through](https://stackoverflow.com/questions/279170/utf-8-all-the-way-through) – JosefZ Apr 22 '21 at 14:13

0 Answers0