0

I create database like always:

CREATE DATABASE my_db CHARACTER SET utf8 COLLATE utf8_general_ci;

I have dumped states.sql which looks fine but when I dump them to database I see strange symbols and letters where POLISH chart should be.

When I try add from some answers:

default-character-set=utf8
character-set-server=utf8
default-collation=utf8_unicode_ci

to my.cf - mysql doesn't want to restart.

I can also say that when I do in phpmyadmin for example:

SELECT * FROM 'states' WHERE name = 'gorzów'

I got error from mysql syntax with non utf-8 symbols.

Where can be problem?

Wordica
  • 2,427
  • 3
  • 31
  • 51
  • Have a look here [3513773](http://stackoverflow.com/questions/3513773) and / or here [8288](http://dba.stackexchange.com/questions/8288) – zyexal Mar 29 '16 at 02:28

1 Answers1

0

Did gorzów turn into gorzów? That would be Mojibake.

This is the classic case of

  • The bytes you have in the client are correctly encoded in utf8 (good).
  • You connected with SET NAMES latin1 (or set_charset('latin1') or ...), probably by default. (It should have been utf8.)
  • The column in the tables may or may not have been CHARACTER SET utf8, but it should have been that.

Since you did not state what client you are using, nor what syntax you used for connecting, I can't be more specific. Perhaps http://mysql.rjweb.org/doc.php/charcoll#python, or the sections that follow, will help.

Rick James
  • 135,179
  • 13
  • 127
  • 222