Home > Database > Mysql Tutorial > 20140530-MySQL插入中文问题再做笔记_MySQL

20140530-MySQL插入中文问题再做笔记_MySQL

WBOY
Release: 2016-06-01 13:12:41
Original
755 people have browsed it

20140530-MySQL插入中文问题再做笔记

1、脚本语句

导入之前,先charset gbk。

修改表字段编码:

注意:这里用导入的方式插入的数据,控制台会报错。在我们的客户端工具中执行,就不会报错了。

2、MyBatis中,xml文件引入成为mapper的配置:

3、写junit测试类的时候,中文数据不能正常读取:

解决办法:字符串连接参数要添加一下。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template