hibernate中向mysql数据库插入汉字出现???乱码问题的纠正
2012-04-16 19:53
357 查看
如题,试过多种方法无效后,苦思中。。。
感觉自己的mysql数据库有问题,于是从官网下载后重安装了一遍,在mysql-front 插入汉字开始也出现乱码,确定是mysql自身的问题,于是修改了my.ini文件,修改代码如下(红字加粗,两处)后在mysql-front修改问题解决,而且在由hibernate向mysql写入汉字正常。\(^o^)/~
[client]
# CLIENT SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by MySQL client applications.
# Note that only client applications shipped by MySQL are guaranteed
# to read this section. If you want your own MySQL client program to
# honor these values, you need to specify it as an option during the
# MySQL client library initialization.
#
[client]
port=3306
[mysql]
default-character-set=gbk
# SERVER SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by the MySQL Server. Make sure that
# you have installed the server correctly (see above) so it reads this
# file.
#
[mysqld]
# The TCP/IP Port the MySQL Server will listen on
port=3306
#Path to installation directory. All paths are usually resolved relative to this.
basedir="D:/Program Files/MySQL/MySQL Server 5.0/"
#Path to the database root
datadir="D:/MySQL/MySQL Server 5.0/Data/"
# The default character set that will be used when a new schema or table is
# created and no character set is defined
default-character-set=utf8
感觉自己的mysql数据库有问题,于是从官网下载后重安装了一遍,在mysql-front 插入汉字开始也出现乱码,确定是mysql自身的问题,于是修改了my.ini文件,修改代码如下(红字加粗,两处)后在mysql-front修改问题解决,而且在由hibernate向mysql写入汉字正常。\(^o^)/~
[client]
# CLIENT SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by MySQL client applications.
# Note that only client applications shipped by MySQL are guaranteed
# to read this section. If you want your own MySQL client program to
# honor these values, you need to specify it as an option during the
# MySQL client library initialization.
#
[client]
port=3306
[mysql]
default-character-set=gbk
# SERVER SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by the MySQL Server. Make sure that
# you have installed the server correctly (see above) so it reads this
# file.
#
[mysqld]
# The TCP/IP Port the MySQL Server will listen on
port=3306
#Path to installation directory. All paths are usually resolved relative to this.
basedir="D:/Program Files/MySQL/MySQL Server 5.0/"
#Path to the database root
datadir="D:/MySQL/MySQL Server 5.0/Data/"
# The default character set that will be used when a new schema or table is
# created and no character set is defined
default-character-set=utf8
相关文章推荐
- python向mysql数据库插入汉字出现乱码问题
- Mysql中插入汉字出现乱码问题
- hibernate插入Mysql数据库出现中文乱码情况从这5个方面解决
- 使用Hibernate框架操作MySQL数据库插入中文字符时出现乱码
- MySQL插入显示汉字出现乱码问题的解决
- 解决Hibernate向MySQL数据库插入中文乱码问题
- 采用hibernate写入中文到mysql数据库出现中文乱码的问题
- MySQL插入显示汉字出现乱码问题的解决
- 关于用php插入汉字到oracle中出现不乱码问题
- MySQL数据库 查询表数据出现中文乱码 及 插入中文报错Incorrect string value问题解决方法
- 将数据插入到Mysql数据库表中时,出现中文显示乱码问题
- eclipse插入数据到MySQL数据库时,出现中文乱码问题的解决方法
- eclipse3.2下解决数据插入mysql数据库时乱码无法插入问题(Hibernate)
- 使用hibernate往mysql数据库插入数据中文乱码问题
- 解决Hibernate向MySQL数据库插入中文乱码问题
- mysql数据库插入汉字乱码问题
- 在mysql数据库插入中文数据出现乱码(利用可视化工具不存在问题)
- 解决JSP在MySQL数据库中进行插入出现乱码的问题
- 解决jsp插入mysql数据库中的数据出现乱码问题
- 关于hibernate插入数据到mysql数据库中文乱码问题的解决