프로그래머호이잇

MYSQL DB, TABLE char set 변경 방법 본문

DB

MYSQL DB, TABLE char set 변경 방법

호이잇! 2017. 9. 7. 11:48

char set 확인 방법


SELECT default_character_set_name FROM information_schema.SCHEMATA S

WHERE schema_name = 디비명;

 

show CREATE DATABASE 디비명;

show CREATE TABLE 테이블명;

 


--------------------------------DB 케릭터셋 변경


use mysql;

SET character_set_client = utf8;

SET character_set_results = utf8;

SET character_set_connection = utf8;

ALTER DATABASE gamehada DEFAULT CHARACTER SET utf8;

 

-------------------------table 케릭터셋 변경


use 디비명;


ALTER TABLE 테이블명 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci


alter table 테이블명 convert to character set utf8;