Welcome 微信登录

首页 / 操作系统 / Linux / 在Ubuntu系统中如何解决MySQL在命令行中文乱码

1)修改/etc/mysql/my.cnf
sudo gedit /etc/mysql/my.cnf
在my.cnf文件中的[client]段和 [mysqld]段加上以下两行内容:
[client]
default-character-set=utf8
[mysqld]
default-character-set=utf8注意是utf8,而不是utf-8:-)2)重启mysql服务sudo service mysql restart3)登陆并检查配置mysql -u root -p show variables like "char%";更多Ubuntu相关信息见Ubuntu 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=2在Ubuntu上配置PHP调试环境Vim+XDebugUbuntu中出现xxx is not in the sudoers file解决方法相关资讯      Ubuntu入门教程 
  • 10个调整让Ubuntu宾至如归  (08/25/2014 06:51:16)
  • Ubuntu 11.10 升级到 12.04 后   (05/20/2012 08:58:03)
  • Ubuntu下的IPMI  (05/19/2012 08:25:38)
  • Ubuntu 12.04 Server安装Gerrit  (05/21/2012 05:42:28)
  • Ubuntu的preseed文件  (05/19/2012 08:26:30)
  • Ubuntu 直接修改IPMIweb登录密码  (05/19/2012 08:24:01)
本文评论 查看全部评论 (0)
表情: 姓名: 字数