Cause: java.sql.SQLException: Incorrect string value: '\xF0\x9F\x99\x84' for column 'nickname' at row 1
; uncategorized SQLException; SQL state [HY000]; error code [1366]; Incorrect string value: '\xF0\x9F\x99\x84' for column 'nickname' at row 1; nested exception is java.sql.SQLException: Incorrect string value: '\xF0\x9F\x99\x84' for column 'nickname' at row 1
如果是本地数据库
#4.将如下配置加入my.cnf配置文件
[client]
default-character-set = utf8mb4
[mysql]
default-character-set = utf8mb4
[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
init_connect='SET NAMES utf8mb4'
如果是云数据库
阿里云:
腾讯云: