日期:2014-05-16 浏览次数:20709 次
$sudo emacs /etc/my.cnf
#配置客户端 [client] #默认字符集为utf8 default-character-set=utf8 #配置服务器端 [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 #默认字符集为utf8 default-character-set=utf8 #设定连接数据库时使用utf8编码 init_connect='SET NAMES utf8' #设定使用的数据库存储引擎 default-storage-engine=INNODB [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid
$sudo /etc/init.d/mysqld restart
mysql> \s
mysql> \s -------------- mysql Ver 14.14 Distrib 5.1.52, for redhat-linux-gnu (i386) using readline 5.1 Connection id: 11 Current database: projectforge Current user: root@localhost SSL: Not in use Current pager: stdout Using outfile: '' Using delimiter: ; Server version: 5.1.52 Source distribution Protocol version: 10 Connection: Localhost via UNIX socket Server characterset: utf8 Db characterset: utf8 Client characterset: utf8 Conn. characterset: utf8 UNIX socket: /var/lib/mysql/mysql.sock Uptime: 2 hours 55 min 24 sec Threads: 9 Questions: 620 Slow queries: 0 Opens: 68 Flush tables: 1 Open tables: 61 Queries per second avg: 0.58 -------------- mysql>