现在的位置: 首页 > 综合 > 正文

用MySQL链接myeclipse的乱码

2012年09月20日 ⁄ 综合 ⁄ 共 951字 ⁄ 字号 评论关闭

用MySQL链接到myeclipse 会遇到乱码问题,我想这也是很多人遇到的问题,下面我来讲解一下到底如何解决这些乱码问题,

首先在MySQL能够正常显示,但是却链接到myeclipse中建立好dbbrowser后,右键connected to mysql 后,单击New SQL editor 出来之后,查看表里的内容,出现的是乱码,这有可能是mysql编码配置的问题,应该作如下更改,找到mysql的配置文件夹my.ini,作如下修改 。

[client]

port=3306

[mysql]

default-character-set=GBK    //这是需要更改的地方,有人可能会是latin1

# 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="E:/Mysql/mysql sever/"

#Path to the database root
datadir="E:/Mysql/mysql sever/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本地的字符存取,需要更改  有人可能会是latin1

 

改好之后,去控制面板服务里面 先把mysql的服务关掉然后再重新启动(这很重要),然后再删掉原有旧编码的表,这样建立的新表,在myeclipse中就不会有乱码的问题

抱歉!评论已关闭.