参照mysql 5.5配置文件修改mysql 5.6配置文件
操作系统centos 6.3 32位
默认mysql5.6配置文件
# for advice on how to change settings please see
#
# *** do not edit this file. it's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of mysql.
[mysqld]
# remove leading # and set to the amount of ram for the most important data
# cache in mysql. start at 70% of total ram for dedicated server, else 10%.
# innodb_buffer_pool_size = 128m
# remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
# these are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
# server_id = .....
# socket = .....
# remove leading # to set options mainly useful for reporting servers.
# the server defaults are faster for transactions and fast selects.
# adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128m
# sort_buffer_size = 2m
# read_rnd_buffer_size = 2m
sql_mode=no_engine_substitution,strict_trans_tables
使用默认配置文件启动后mysql5.6的情况
mysql> status;
--------------
mysql ver 14.14 distrib 5.6.10, for linux (i686) using editline wrapper
connection id: 1
current database:
current user: root@localhost
ssl: not in use
current pager: stdout
using outfile: ''
using delimiter: ;
server version: 5.6.10 source distribution
protocol version: 10
connection: localhost via unix socket
server characterset: latin1
db characterset: latin1
client characterset: utf8
conn. characterset: utf8
unix socket: /tmp/mysql.sock
uptime: 10 sec
threads: 1 questions: 5 slow queries: 0 opens: 67 flush tables: 1 open tables: 60 queries per second avg: 0.500
--------------
可以看出“server characterset”、“db characterset”这两项默认为“latin1”,如果我们需要更改默认字符集,请在my.cnf配置文件中添加
character-set-server=utf8
之后重启mysql服务
service mysql restart
,