THE ORB
Starting the studio

Incorrect string value: '\xF0\x9F...' for column

Someone had an emoji in their name and your database cannot store emojis.

groupsThat player cannot savecodeNeeds a developer

Do this first

Your database and its connection both need to use utf8mb4. It is a one-time change.

bug_reportPaste your whole console instead

What it means

A character was written that the column's character set cannot represent. The byte sequence in the message starting \xF0\x9F is an emoji: four bytes, and MySQL's old utf8 is a three-byte encoding that cannot store them.

What causes it

Ordered by how often it is the answer.

  1. 1

    An emoji in a player name or a chat message

    The single most common form. Discord and Steam names are full of them.

  2. 2

    The database is utf8 rather than utf8mb4

    MySQL's utf8 has always been a partial UTF-8. utf8mb4 is the real one.

  3. 3

    The connection charset is not set

    The table can be utf8mb4 and the CONNECTION still utf8, which fails the same way. This is the one people miss.

  4. 4

    Accented or CJK text in a latin1 column

    An older schema that was never migrated.

How to tell which one is yours

SHOW VARIABLES LIKE 'character_set_%';
SHOW FULL COLUMNS FROM users;

If the column says utf8mb4 but the connection says utf8, the connection string is the problem.

Where to look

The connection string in server.cfg, and the table's charset.

How to fix it

Set both. The connection first, since it is the half that gets forgotten:

set mysql_connection_string "mysql://user:pass@host/db?charset=utf8mb4"

Then the schema:

ALTER DATABASE mydb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE users CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

Still stuck on your own code?

This page is what this error usually means. Paste your console into Server Fixer and it will rank everything in it and tell you what to do first, and if you would rather not touch it, ORBIE can repair the script and hand the resource back ready to drop in.

bug_reportOpen Server Fixer

Errors that travel with this one