Get the App
SLTechnology News&Howtos  ›  Database  › 

MySQL 4.1 + support for multiple characters

Shulou Source: shulou.com Published: 2022-06-01 06:25:08 10月02日 Update

Character Set Support in MySQL 4.1 has two aspects: Character sets and Collations. Support for character sets is refined to four levels:

Server, database, table and connection.

In practice, even if you set the default character set of the table to UTF-8 and send the query with UTF-8 encoding, you will find that the database is still garbled. The problem lies in this connection layer. The solution is to execute the following sentence before sending the query:

SET NAMES 'utf8';

In PHP, select_db is executed after connect/pconnect.

[@more@]

SET NAMES 'x' statement is equivalent to 3 statements:

SET character_set_client = x;

SET character_set_results = x;

SET character_set_connection = x;

Reference:

http://dev.mysql.com/doc/refman/5.0/en/charset-connection.html

Tags: Character character set data support database is in statement UTF-8 query two garbled actual hierarchical data table method method aspect server coding problem Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL NVidia Huawei Redmi Microsoft