2017년 3월 21일 화요일

MariaDB charset UTF8 설정

MariaDB charset UTF8 설정


CentOS 7.x 버전에 APM 을 설치했더니 MySQL 디폴트 문자셋이 latin1 으로 되어있네요.

/etc/my.cnf 를 수정해주면 됩니다.

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd

init_connect='set names utf8'
character-set-server=utf8

위 두줄은 추가해주고

# systemctl restart mariadb