ODBC connector support for utf8mb4 in MYSQL

2019-09-12 04:28发布

问题:

I have been stuck up in this scenario.

My application is in C++ which connects to MySQL database 5.5.34 through MySQL odbc connector v5.2 Unicode Driver.

My tables were using the character set and collation properties 'utf-8'. To insert supplementary unicode characters, i changed it via

My table was initially created:

CREATE TABLE mytable (SAMPLECOLUMN text) ENGINE=InnoDB DEFAULTCHARSET=utf8;

changed to,
ALTER TABLE mytable CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

After this, I am able to directly (not through my app) insert the supplementary characters into the column holding 'TEXT' data type.

The odbc connector crashes when it encounters supplementary characters.

The following are some of my my.ini configurations.

[mysql]
default-character-set=utf8

[mysqld]
character-set-server=utf8
default-storage-engine=INNODB

The query that i am trying to insert:

INSERT INTO mytable (SAMPLECOLUMN) VALUES ("乕乭