/etc/mysql/my.cnf
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
#[mysqld]
#collation-server = utf8_general_ci
#character-set-server = utf8
#skip-character-set-client-handshake
[client]
default-character-set = utf8
[mysqld]
character-set-client-handshake=FALSE
init_connect="SET collation_connection = utf8_general_ci"
init_connect="SET NAMES utf8"
character-set-server = utf8
collation-server = utf8_general_ci
lower_case_table_names = 1
max_allowed_packet = 1024M
[mysqldump]
default-character-set = utf8
[mysql]
default-character-set = utf8
default chracter set
은 optional 이지만, 한글을 위해 아래와 같이 설정한다.
create database ${database-name} default chracter set utf8;