我用的是ubuntu 15.04系统,mysql出现中文乱码问题。如下图:
mysql> \s
--------------
mysql Ver 14.14 Distrib 5.6.24, for debian-linux-gnu (x86_64) using EditLine wrapper
Connection id: 3
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.6.24-0ubuntu2 (Ubuntu)
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: /var/run/mysqld/mysqld.sock
Uptime: 5 min 29 sec
找到mysql的配置文件后,按如下步骤设置后,mysql不能启动了!!!
{
在[client] 添加:
default-character-set=utf8 //默认字符集为utf8
找到[mysqld] 添加:
default-character-set=utf8
init_connect='SET NAMES utf8'
}
修改好后,mysql启动不了。把修改注释后才能启动!
请问,怎么才能把mysql中的
Server characterset: latin1
Db characterset: latin1
的latin1 永久修改为utf8?望高手不吝赐教!
cs1200 于 2015-06-26 18:47:04发表:
要程序里判断偏码就不会乱了