首页 > 数据库技术 > 详细

linux mysql 中文乱码的问题

时间:2014-07-22 23:07:43      阅读:428      评论:0      收藏:0      [点我收藏+]

搜索了不少资料,都不起作用,还是stackoverflow上的一位老兄的建议解决了我的问题,见:http://stackoverflow.com/questions/3513773/change-mysql-default-character-set-to-utf8-in-my-cnf

在上面网址对应的页面中,有图有真相;

我就摘抄几行:

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Then your configuration file (‘/etc/my.cnf‘ for example) should look like that:(但是不一定就是在/etc/my.cnf这个目录里,我的就是/etc/mysql/my.cnf文件)

  1. Remove that directive and you should be good.

  2. Then your configuration file (‘/etc/my.cnf‘ for example) should look like that:

    [mysqld]
    collation-server = utf8_unicode_ci
    init-connect=‘SET NAMES utf8‘
    character-set-server = utf8
  3. Restart MySQL.

  4. For making sure, your MySQL is UTF8, Run the following queries in your MySQL prompt:

    • First query:

       mysql> show variables like‘char%‘;
以下内容见http://stackoverflow.com/questions/3513773/change-mysql-default-character-set-to-utf8-in-my-cnf,粘贴复制也是很麻烦的


linux mysql 中文乱码的问题

原文:http://www.cnblogs.com/passer1991/p/3515027.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!