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"