0

I am executing this query in MySQL:

INSERT INTO album_tracks (album_id, name, guid, position, duration, ranked)
VALUES
    ('1214','','c1983e4d-cc94-4f11-9716-8fc7851494cc','2','369','2')

I receive the following error: still get Error Code: 1366.

Incorrect string value: '\xF0\x9D\x9C\x8B' for column at row 1

I am executing query directly in MySQL Workbench (6.3.10) and using MySQL 5.7+.

I did change table and column (name) to "utf8mb4" (called "utf8mb4- default collation" in MySQL Workbench) , while changing the table collation to utf8mb4 should be enough i still get the same result (error).

I checked many threads about this, but couldn't solve it.

Note that i can Insert characters successfully like: 協奏曲集《四季》 or ★

Dror
  • 1,262
  • 3
  • 21
  • 34
  • Please review the duplicate link, which covers the same exact problem you describe. Try 1-2 of the highly upvoted answers, and if none work, then edit your questions and state what steps you have already taken. – Tim Biegeleisen Jun 05 '18 at 06:43
  • @TimBiegeleisen The linked page is about JDBC and the answers are years old (and don't apply to MySQL Workbench). I'm voting to reopen this question here. – Mike Lischke Jun 05 '18 at 06:58
  • @Dror Check the structure of your table. Does this column allow utf-8 content? – Mike Lischke Jun 05 '18 at 07:00
  • @MikeLischke Most of the answers don't have anything to do with JDBC. I doubt the OP read that question before posting. – Tim Biegeleisen Jun 05 '18 at 07:02
  • I already read that thread and tried suggestions from there. Like @TimBiegeleisen suggests i directly run the query inside MySQL Workbench and not any C# gateway. It might be MySQL Workbench issue. – Dror Jun 05 '18 at 08:18
  • You said this is your last resort; if so, then show us what you have tried. – Tim Biegeleisen Jun 05 '18 at 08:19
  • I changed column (name) and table Collation to utf8mb4. I believe that should be enough to accept a . – Dror Jun 05 '18 at 08:23
  • Updated question to be more specific – Dror Jun 05 '18 at 08:58

1 Answers1

1

This is a limitation of MySQL Workbench before 8.0. The utf8mb4 character set is not supported there. Instead download the RC of MySQL Workbench 8.0.11 (see "Development Releases" on the download page), which supports that character set.

Mike Lischke
  • 48,925
  • 16
  • 119
  • 181
  • I see, nice, is it stable and similar to current MySQL Workbench? Could i just change to utf8mb4 with a query without using UI of version 6.3.10? – Dror Jun 05 '18 at 17:21
  • Yes, the RC is pretty stable. We haven't heard of any bigger issue. Regarding the character set: Workbench implicitly sets the connection and client charsets, when opening a connection, to utf8 (which is a synonym for utf8mb3 currently, but in the RC utf8mb4 is used instead). Changing these charsets manually can cause trouble since Workbench expects all data in UTF-8, always. – Mike Lischke Jun 06 '18 at 05:51