I
I
Ivan Melnikov2018-05-31 17:50:11
MySQL
Ivan Melnikov, 2018-05-31 17:50:11

What is the difference between character_set_client and character_set_connection?

Question 1 : Let's say character_set_client = cp1251. Does this mean that the MySQL server will expect cp1251-encoded sql-query text from the client?
Question 2 : Now, let character_set_connection = utf8mb3 and let it be required in the sql query to compare the string with the type field of the animals table. The type field of the animals table is encoded koi8r. The query, for example, is:
SELECT id FROM animals WHERE type = 'cat'.
MySQL server receives this request in cp1251 encoding, then converts the type record field from koi8r encoding to utf8mb3 encoding and the string 'cat' from cp1251 encoding to utf8mb3 encoding, and only after that does it compare (according to the set collation)?
Question 3 : In the ODBC driver, the connection string says
5b100a31930c4280571779.jpeg
The line "STMT=SET CHARACTER SET cp1251;" sets the client encoding (character_set_client)? And if it is missing, then the default value set by character_set_client = cp1251 in my.ini will apply?
Am I understanding everything correctly?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question