MySQL 更新中国列:1366 Incorrect string value 问题解决了

it2025-07-23  18

周围环境:Win7 64位置,mysql-5.6.25-winx64,MySQL workbench

问题:MySQL在更新时出现异常:

 warning(s): 1366 Incorrect string value: '\xE8\x82\x96\xE5\xB1\xB1...' for column 'sub_station_name'

解决:

1、数据库schema字符集设置为utf-8

2、表字符集设置为utf-8

3、中文列字符集设置为utf-8

4、连接url里面已经指定了CharsetEncode=utf8

第4步很关键。

备注:

1、看数据库字符集

show create database test;

注:test为数据库名。

2、看数据表字符集 show create table t_data;

注意:t_data表名。

版权声明:本文博主原创文章。博客,未经同意不得转载。

转载于:https://www.cnblogs.com/bhlsheji/p/4866510.html

相关资源:mysql:1366: Incorrect string value: ‘\xE9\x9…..问题解决
最新回复(0)