지난 포스팅때 CentOS7에 마리아db를 설치 해보았었다
yum으로 설치한 마리아DB에서 인코딩 설정은 심플하더라... ㅎㅎ
추가로 할 내용은 없다 그냥 설명 시작!!
MariaDB [(none)]> show variables like 'c%'; +--------------------------+----------------------------+ | Variable_name | Value | +--------------------------+----------------------------+ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | latin1 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | latin1 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | | collation_connection | utf8_general_ci | | collation_database | latin1_swedish_ci | | collation_server | latin1_swedish_ci | | completion_type | NO_CHAIN | | concurrent_insert | AUTO | | connect_timeout | 10 | +--------------------------+----------------------------+ 14 rows in set (0.00 sec)
몇가지가 utf8이아닌 latin1 이다
대략 보니 서버쪽 부분만 latin 인코딩인대 이것을 utf8로 변경해보도록 하자
[root@localhost etc]# vi /etc/my.cnf [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock character_set_server = utf8 <- 추가를 해주도록 하자: # 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 [mysqld_safe] log-error=/var/log/mariadb/mariadb.log pid-file=/var/run/mariadb/mariadb.pid # # include all files from the config directory # !includedir /etc/my.cnf.d
character_set_server = utf8 추가해준 후 service 재시작을 해보도록 하자
[root@localhost etc]# systemctl stop mariadb.service [root@localhost etc]# systemctl start mariadb.service
별 오류없이 위의 명령어가 동작되었으면 다시한 번 mysql 접속후 show variables like 'c%'; 명령어를 주어 확인해보도록 하자
MariaDB [(none)]> show variables like 'c%'; +--------------------------+----------------------------+ | Variable_name | Value | +--------------------------+----------------------------+ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | | collation_connection | utf8_general_ci | | collation_database | utf8_general_ci | | collation_server | utf8_general_ci | | completion_type | NO_CHAIN | | concurrent_insert | AUTO | | connect_timeout | 10 | +--------------------------+----------------------------+ 14 rows in set (0.00 sec)
위와같이 정상적으로 UTF8설정이 변경되었다면 성공
마리아DB(MariaDB)를 로컬서버(리눅스)에 설치해보기 (0) | 2014.08.05 |
---|