/etc/my.cnf

#配置客户端
[client]
#默认字符集为utf8
default-character-set=utf8

#配置服务器端
[mysqld]
#启用binary log
log-bin=mysql-bin
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
# mysql 5.5.14配置默认字符集被底下配置取代
#character_set_server=utf8 
#设定连接数据库时使用utf8编码
init_connect='SET NAMES utf8' 
#设定使用的数据库存储引擎
default-storage-engine=INNODB

wait_timeout=2592000  
interactive_timeout=2592000 

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

你可能感兴趣的:(my.cnf)