MySQL database and table have been set to utf8mb4 character set
2、 problem:
Insert "Клубная карта доступа к закрытому сообществу." into the database through database/sql and report an error: Error 1366: Incorrect string value: '\xD1' for column 'name' at row 1
Insert "Клубная карта доступа к закрытому" into database successfully through database/sql
Insert "Клубная карта доступа к закрытому сообществу." into the database successfully through navicat premium database tool
So I think the problem is a database/sql bug.
What version of Go are you using (go version)?
$ go version
go version go1.17.11 darwin/amd64
Does this issue reproduce with the latest release?
uncertain
What operating system and processor architecture are you using (go env)?
1、mysql my.cnf config: [client] default-character-set=utf8mb4 [mysql] default-character-set=utf8mb4 [mysqld] character-set-server=utf8mb4 collation-server = utf8mb4_general_ci
MySQL database and table have been set to utf8mb4 character set
2、 problem: Insert "Клубная карта доступа к закрытому сообществу." into the database through database/sql and report an error: Error 1366: Incorrect string value: '\xD1' for column 'name' at row 1
Insert "Клубная карта доступа к закрытому" into database successfully through database/sql
Insert "Клубная карта доступа к закрытому сообществу." into the database successfully through navicat premium database tool
So I think the problem is a database/sql bug.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
uncertain
What operating system and processor architecture are you using (
go env
)?GOHOSTARCH="amd64" GOHOSTOS="darwin"
go env
OutputWhat did you do?
blockchain developer
What did you expect to see?
I want to be able to insert "Клубная карта доступа к закрытому сообществу." into mysql database via database/sql
What did you see instead?