我的mysql 5.1 用的是 utf8字符集, 这 个字符集是不是不支持中文啊 , 怎么不管插什么 中文数据就抱错
我该怎么解决往mysql 中插中文数据 最好配置一次就好 还有我的jsp页面用的也是 utf-8, 

解决方案 »

  1.   

    楼主回复:
      那 如果我是重jsp 得到数据 往mysql 插数据, jsp 的字符集不是GBK 是不是插入的数据是乱码!! 比如 我的jsp 默认的是gb18030 而mysql 用的gbk
      

  2.   

    都改成utf-8 网页上也是。。utf-8更好用。
      

  3.   

    都改成utf-8,但有时还会出现乱码问题,
       不妨在getParameter()
          获取请求信息前加入
       request.setCharacterEncoding("gb2312");
        希望对你有帮助
      

  4.   

    都改成utf-8,但有时还会出现乱码问题,
       不妨在getParameter()
          获取请求信息前加入
       request.setCharacterEncoding("gb2312");
        希望对你有帮助
      

  5.   

    都改成utf-8,但有时还会出现乱码问题,
       不妨在getParameter()
          获取请求信息前加入
       request.setCharacterEncoding("gb2312");
        希望对你有帮助
      

  6.   

    有时候是mysql的客户端软件的问题,我就遇到过同样的sql脚本在SQlyog不同的版本中有的好着,有的不行!你要不换个客户端试试!
      

  7.   

    在mysql的安装目录下找到my.ini
    在里面找到:default-character-set=将值改成gbk或gb2312或utf8都可以,
    如下面:default-character-set=utf8
      

  8.   

    在确认你的数据库和应用都是utf8的情况下,如果还出错,就把数据库的URL设置为
    假设连本地的test数据库:
    jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8;
      

  9.   

    最好的方法还是安装时把Mysql改为"GBK"
      

  10.   

    你设计的数据库字段类型collation改成gck-chinese-ci
      

  11.   

    MySql安装目录下有个my.ini文件,
    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="C:/Program Files/MySQL/MySQL Server 5.2/"#Path to the database root
    datadir="C:/Program Files/MySQL/MySQL Server 5.2/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=gbk这两处默认的编码方式可能是不支持中文的 ,修改一下
      

  12.   

    数据库,页面全部改成utf-8
    在创建表的时候需要插入中文的字段后面加上character set utf8
    比如
    id int(4),
    address varchar(200) character set utf8,
    ....
    .... 
      

  13.   

    在DOS下插入中文数据会乱码不
      

  14.   

    用过滤器.整个项目都会调用到这个类的..不用每次插入都要写.request.setCharacterEncoding("gb2312"); 数据库改成UTF-8.jsp页面改成UTF-8.它就不会乱码了..
      

  15.   

    第一: 数据库链接设置的是不是utf-8
    第二: 数据库是不是utf-8,注意 数据库也许是utf-8,但要确认表是不是utf-8,也许那个字段不是utf-8
    自己玩去巴