1.mysql的编码 如utf8 (一般在my.ini中该)
2.myeclipse database explorer连接mysql时,url:jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8;
3.建表时,如:
drop table if exists cx;
create table cx(
d_id int auto_increment primary key,
d_name varchar(20)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
insert into cx value (null,'中文');
本文详细介绍了如何在MySQL中设置UTF8编码,包括修改配置文件my.ini、设置myeclipse数据库连接参数、创建表时指定字符集等步骤,确保数据库能够正确存储和显示中文。
711

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



