Thanks to visit codestin.com
Credit goes to github.com

Skip to content

MySQL utf8mb4 encoding error #131

@muety

Description

@muety

When trying to insert an entity (user, heartbeats, ...) containing Unicode emojis, the following error is thrown.

[ERROR] failed to batch-insert heartbeats – Error 3988: Conversion from collation utf8mb4_0900_ai_ci into latin1_swedish_ci impossible for parameter

There are two reasons for this:

  1. Depending on how and with what MySQL version you created your database, the tables' character set might not be utf8, but something like latin1 or so
  2. The database connection uses utf8 character set, but not utf8mb. Accordingly, 4-byte characters (like 💩) can't be sent to the database

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingprio a

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions