mysql utf8 설정

0

/etc/mysql/conf.d/mysql.cnf 수정

[mysqld] datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
character-set-server=utf8
collation-server=utf8_general_ci
init_connect = set collation_connection = utf8_general_ci
init_connect = set names utf8

[mysql] default-character-set=utf8

[mysqld_safe] log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
default-character-set=utf8

[client] default-character-set=utf8

[mysqldump] default-character-set=utf8

 

/etc/mysql/mysql.conf.d/mysqld.cnf 수정

[mysqld_safe] socket          = /var/run/mysqld/mysqld.sock
nice            = 0
[mysqld] group_concat_max_len = 2048
max_connections = 1000
sql_mode = ‘NO_ENGINE_SUBSTITUTION’
user            = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
port            = 3306
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
key_buffer_size         = 16M
max_allowed_packet = 1048576000
thread_stack            = 192K
thread_cache_size       = 8
myisam-recover-options  = BACKUP
query_cache_limit       = 1M
query_cache_size        = 16M
log_error = /var/log/mysql/error.log
expire_logs_days        = 10
max_binlog_size   = 100M

 

 

About Author