标签:base 设置 ase efault exce div create java character
java.sql.SQLException: Incorrect string value: ‘\xE7\x9A\x84‘ for column ‘name‘ at row 1
在创建创建数据库设置
CREATE DATABASE IF NOT EXISTS database_name DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
创建时未设置可以通过以下方法解决
1)修改字段字符集
ALTER TABLE table_name CHANGE column_name VARCHAR(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER DATABASE database_name CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
标签:base 设置 ase efault exce div create java character
原文地址:https://www.cnblogs.com/hongjia/p/12650356.html