"Character_set_results" Problem in MySql4.0 Database

Source: Internet
Author: User

Yesterday, when I deployed my MAS interface program, the Client IP address 192.168.1.100 and the MAS interface program were deployed on the client.

Server IP: 192.168.1.101, MySql4.0 database.

Program connection to MySql: ODBC, driver: mysql odbc driver5.1 (this is the driver used before connection failure)

The connection string is as follows (C #):

ConnectionString = "Driver = {MySQL ODBC 5.1 Driver}; Server = 192.168.1.101; Port = 3306; Option = 131072; Stmt =; Database = mas; User = root; Password = 123456 ". when this connection string is used to connect data, an exception is returned: unknow system varibles "character_set_results "...... I guess it's about character sets. I checked the MYSQL Character Set documentation. Let's just briefly describe it ,.

1. character_set_database: ensure that the data stored in the database is consistent with the database encoding;

2. Ensure that the character sets for communication are consistent with those for databases, that is, character_set_client and character_set_connection are consistent with character_set_database;

3. Ensure that the returned results of SELECT are encoded in the same way as those of the program, that is, character_set_results is encoded in the same way as the program;

4. Ensure that the program code is consistent with the browser code, that is, the program code is consistent.

I changed the connection string and set character_set_results = uft8. This is really an annoying problem.

Fortunately, I calmly analyzed whether the driver version was a problem. My mysql driver version is 5.1, and mysql version is 4.0.

Download the driver from the official website, change the driver of driver3.51, and connect again!

ConnectionString = "Driver = {MySQL ODBC 3.51 Driver}; Server = 192.168.1.101; Port = 3306; Option = 131072; Stmt =; Database = mas; User = root; Password = 123456"

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.