Develope/DataBase

[MYSQL] character set UTF8, 서버 클라이언트 모두 수정

고로이 2017. 10. 31. 14:16
반응형
MariaDB [(none)]> status
--------------
mysql  Ver 15.1 Distrib 10.1.28-MariaDB, for Linux (x86_64) using readline 5.1
Connection id:          62
Current database:
Current user:           otdev@localhost
SSL:                    Not in use
Current pager:          stdout
Using outfile:          ''
Using delimiter:        ;
Server:                 MariaDB
Server version:         10.1.28-MariaDB MariaDB Server
Protocol version:       10
Connection:             Localhost via UNIX socket
Server characterset:    latin1
Db     characterset:    latin1
Client characterset:    utf8
Conn.  characterset:    utf8
UNIX socket:            /var/lib/mysql/mysql.sock
Uptime:                 16 hours 20 min 0 sec
Threads: 20  Questions: 1698  Slow queries: 0  Opens: 46  Flush tables: 1  Open                                                                                                                                                              tables: 36  Queries per second avg: 0.028
--------------



/etc/my.cnf 를 수정하자


[mysqld]
collation-server = utf8_unicode_ci
character-set-server = utf8
skip-character-set-client-handshake



service mysql restart


MariaDB [(none)]> status
--------------
mysql  Ver 15.1 Distrib 10.1.28-MariaDB, for Linux (x86_64) using readline 5.1
Connection id:          2
Current database:
Current user:           otdev@localhost
SSL:                    Not in use
Current pager:          stdout
Using outfile:          ''
Using delimiter:        ;
Server:                 MariaDB
Server version:         10.1.28-MariaDB MariaDB Server
Protocol version:       10
Connection:             Localhost via UNIX socket
Server characterset:    utf8
Db     characterset:    utf8
Client characterset:    utf8
Conn.  characterset:    utf8
UNIX socket:            /var/lib/mysql/mysql.sock
Uptime:                 9 sec
Threads: 1  Questions: 4  Slow queries: 0  Opens: 17  Flush tables: 1  Open tabl                                                                                                                                                             es: 11  Queries per second avg: 0.444

--------------


반응형