Have the almost the same issue as this. I have this:
$name = "Ирина";
When i insert it into my DB i get this: Ирина.
This function:
print_r(mb_detect_encoding($name));
gives me UTF-8
.
Next thing:
SHOW VARIABLES LIKE 'char%';
Returns me this:
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
And as result of:
SHOW CREATE TABLE my_db.main;
i get: ENGINE=InnoDB DEFAULT CHARSET=utf8
DB was created with this statement:
CREATE DATABASE IF NOT EXISTS my_db DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
When i apply query SET NAMES 'utf8';
info stores correctly. And, finally, the question: Why do i need to execute this query at the beginning of my connection?
P.S. --skip-character-set-client-handshake
in MySQL isn't specified.