当前位置:网站首页>ERROR 1366 (HY000): Incorrect string value: ‘\xE8\xB5\xB5\xE9\x9B\xB7‘ for column ‘s_ name‘ at row 1
ERROR 1366 (HY000): Incorrect string value: ‘\xE8\xB5\xB5\xE9\x9B\xB7‘ for column ‘s_ name‘ at row 1
2022-07-27 18:45:00 【Ding Dang's fantasy】
mysql An error caused by a character set that does not meet the requirements
One of the reasons : The character set is not specified when creating the table , Used after creating fields alter table Student default charset=utf8; Changed the character set to utf8; But it doesn't work for the created fields ;
use show create table table_name\G;
View table creation
mysql> show create table Student\G;
*************************** 1. row ***************************
Table: Student
Create Table: CREATE TABLE `Student` (
`s_id` int(11) NOT NULL AUTO_INCREMENT,
`s_name` varchar(10) CHARACTER SET latin1 DEFAULT NULL,
`s_birth` varchar(10) CHARACTER SET latin1 DEFAULT NULL,
`s_sex` enum(' male ',' Woman ') NOT NULL DEFAULT ' male ',
PRIMARY KEY (`s_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
It is found that the character set of the table is different from that of the field
Modify the character set of the field :
alter table Student modify s_name varchar(10) character set uft8;
边栏推荐
猜你喜欢
随机推荐
音乐律动七彩渐变灯芯片--DLT8S04A-杰力科创
[mit 6.s081] LEC 4: page tables notes
2021.7.18笔记 mysql数据类型
MySQL learns the relationship between Day2 Sorting Query / aggregation function / grouping query / paging query / constraint / multiple tables
Part of speech list of common words
JDBC学习 Day1:JDBC
Basic operations of MySQL view
2021.7.22 note constraints
阿里架构师耗时280个小时整理的1015页分布式全栈小册,轻松入手分布式系统
[MIT 6.S081] Lab 10: mmap
The second parameter of fragmenttransaction.replace reports an error
org.gradle.api. UncheckedIOException: Could not load properties for module ‘gradle-kotlin-dsl‘ from C
Graphical interface programming
Generate PDM file from Navicat export table
10 SQL optimization schemes summarized by Alibaba P8 (very practical)
2021.7.22笔记 约束
[MIT 6.S081] Lab 9: file system
Conflict between blur event and click event in input box
Alibaba architects spent 280 hours sorting out 1015 pages of distributed full stack pamphlets to easily start the distributed system
这样的API网关查询接口优化,我是被迫的


![[mit 6.s081] LEC 9: interrupts notes](/img/b6/a8d39aa7ede4eb1c5a74e6d15b3b1c.png)
![[MIT 6.S081] Lab8: locks](/img/9f/0ff7a0226837a3c420f49e6da8209f.png)





