IT/DBMS 공통
database convert latin1 to utf-8
최고영회
2014. 9. 15. 12:06
728x90
반응형
SMALL
latin1 database converting to utf-8
1. backup
mysqldump -u{username} -p{password} {dbname} --default-character-set latin1 > {dump_file_name}.sql
--default-character-set latin1 이 없으면 온전하게 백업이 되지 않을 수 있다.
2. change character set
iconv -c -f cp949 -t utf-8 {dump_file_name}.sql > {utf8_dump_file_name}.sql
3. change table architecture (use edit plus)
ctrl + r 로 text 찾기(바꾸기)
latin1 => utf8
4. drop database
5. create database
create database {dbname} character set utf8 collate utf8_general_ci;
6. import
mysql --default-character-set utf8 -u{username} -p{password} {dbname} < {utf8_dump_file_name}.sql
728x90
반응형
LIST