安装和配置参考:
https://blog.csdn.net/WYA1993/article/details/88890883
插入中文报错
mysql_stmt_execute failed: Incorrect string value: '\x96\xE5\xBA\x86\xE5\xAF...' for column 'name' at row 1
SET NAMES utf8mb4;
ALTER DATABASE dreams_twitter CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci;
Use the following command to check that the changes are made
SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';
本文档介绍了在安装和配置MySQL时遇到的中文字符插入错误的解决方案。错误信息为'Incorrect string value',提示在name列的第1行。通过设置字符集为utf8mb4并更改数据库和表的collation,可以成功处理包含中文的字符串。检查更改后的字符集设置,使用SHOW VARIABLES命令。此问题涉及数据库编码和国际化支持。


被折叠的 条评论
为什么被折叠?



