My MySQL 5.7 is running on UTF8

mysql> show variables like 'collation%';
| Variable_name        | Value           |
| collation_connection | utf8_general_ci |
| collation_database   | utf8_unicode_ci |
| collation_server     | utf8_unicode_ci |
3 rows in set (0.00 sec)

and for debugging puposes I switched the general log on

general_log = on

Now I'm seeing not correct encoded values inside general.log.

 file /tmp/general.log 
/tmp/general.log: Non-ISO extended-ASCII text, with very long lines, with CRLF, LF line terminators

When searching for Rätsel (German Umlaut ä; ä) I can see inside logs R�tsel (with broken Umlaut).

When having a look with an hexeditor, it appers like

27 2B 52 EF BF BD 74 73 65 6C 20 20 27

Heyedit shows it as '+R...tsel '

Now I'm wondering whether the default encoding of Log is might not UTF-8 (see file statement) or created query by application is wrong.

  • The long lines probably come from long queries. The confusion over encoding may come from a mixture of encodings. Can you get a hex dump of R�tsel (or some other messed up text)? For possible insight into the black diamond, see stackoverflow.com/questions/38363566/… . – Rick James Dec 9 '16 at 0:30
  • as other variant - redirect general log to table and check – a_vlad Dec 9 '16 at 9:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.