본문 바로가기

기술자료/기술운영자료

mysql 특정 DB 캐릭터셋 변경

서버내 TTTT DB utf8로의 캐릭터셋 변경

mysql> show create database TTTT;
+-----------+----------------------------------------------------------------------+
| Database  | Create Database                                                      |
+-----------+----------------------------------------------------------------------+
| TTTT | CREATE DATABASE `TTTT` /*!40100 DEFAULT CHARACTER SET latin1 */ |
+-----------+----------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> alter database TTTT default character set = utf8;
Query OK, 1 row affected (0.03 sec)

mysql> show create database TTTT;
+-----------+--------------------------------------------------------------------+
| Database  | Create Database                                                    |
+-----------+--------------------------------------------------------------------+
| TTTT | CREATE DATABASE `TTTT` /*!40100 DEFAULT CHARACTER SET utf8 */ |
+-----------+--------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.06 sec)

mysql>