java.sql.SQLException: Incorrect string value: '\xF0\x9F\x92\x94' for column 'xxx' at row 1


Samebug tips1

MySQL doesn't support some types of characters (such as emojis) with the utf8 encoding. You need to be on MySQL 5.5+ and force utf8mb4 (everywhere, client and server). You can do this sending the query "SET NAMES utf8mb4". Check this https://goo.gl/3E2qzg


7 months ago
Expert tip

Solutions on the web1044

Solution icon of github
Incorrect string value: '\xF0\x9F\x92\x94' for column 'xxx' at row 1

Solution icon of web
Incorrect string value: '\xF0\x9F\x92\x94' for column 'bo dy' at row 1

Solution icon of github
via GitHub by kfleischmann
, 1 year ago
Incorrect string value: '\xF0\x9F\x92\x99\xF0\x9F...' for column 'message' at row 1

Solution icon of github
Incorrect string value: '\xF0\x9F\x92\xA9</...' for column 'content' at row 1

Solution icon of atlassian
via Atlassian JIRA by Brian Cruz [Atlassian], 1 year ago
Incorrect string value: '\xF0\x9F\x92\x9C\x0D\x0A...' for column 'MESSAGE' at row 1

Solution icon of atlassian
via Atlassian JIRA by Brian Cruz [Atlassian], 1 year ago
Incorrect string value: '\xF0\x9F\x92\x9C\x0D\x0A...' for column 'MESSAGE' at row 1

Solution icon of stackoverflow
Incorrect string value: \'\\xF0\\x9F\\x92\\x9A S...\' for column \'message\' at row 189\n

Solution icon of googlegroups
via Google Groups by Kabir Sood, 10 months ago
Incorrect string value: \'\\xF0\\x9F\\x92\\x9A S...\' for column \'message\' at row 189\n

Solution icon of stackoverflow
Incorrect string value: '\xF0\x9F\x91\x8D\xF0\x9F...' for column 'message' at row 1

Solution icon of web
Incorrect string value: '\xF0\x9F\x91\x8D\xF0\x9F...' for column 'content' at row 1

Stack trace

java.sql.SQLException: Incorrect string value: '\xF0\x9F\x92\x94' for column 'xxx' at row 1
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2620)
	at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1662)
	at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1581)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

Once, 2 months ago
Samebug visitor profile picture
Unknown user
Once, 3 months ago
3 times, 11 months ago
Samebug visitor profile picture
Unknown user
2 times, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
159 more bugmates