Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 |
Tags
- CenOS6.10
- centos7
- 인터넷안되는문제해결
- 아이티제어
- 조성남
- ubunto #네티워크설정
- PID4
- ftp
- php7
- MSSQL #TCP/IP Enabled
- 한글2 #hangul2_from_2024_01_17
- CapsLock키보드 뽑기
- 코드라마 #AI
- 에디트플러스 #sftp안될때
- utf8mb4
- windows19Server
- sftp
- winscp
- PHP4
- root직접로그인
- 윈도우앱지우기
- IT제어
- 신바람여비서win98
- putty
Archives
- Today
- Total
아이티제어
MySQL4버전Latin1에서UTF8로 변환 본문
- mysqldump 를 사용 하여 이전 데이터를 "latin1"으로 추출
- sed 를 사용 하여 덤프 파일에서 "latin1"을 "utf8"로 바꿉니다.
- 올바른 매개변수를 사용하여 새 데이터베이스 생성: 문자 집합 utf8 collate utf8_unicode_ci
- mysql --default-character-set=utf8 을 사용 하여 변환된 덤프를 새 데이터베이스로 파이프하십시오.
# Dump the old database as latin1, because ironically, mysqldump defaults to utf8.
mysqldump --default-character-set=latin1 db > db.dump
# If you need to convert a MySQL dump from one character set to another, use iconv.
iconv -f LATIN1 -t UTF-8 < db.dump > db.dump
# If you've been running mysqldump without parameters on a latin1 instance, you can convert the dump from UTF8 to latin1 to correct it.
iconv -f UTF-8 -t LATIN1 < db.dump > db.dump
# Rewrite the dump to say 'utf8' and 'utf8_unicode_ci' in all the right places.
sed -e 's/SET NAMES latin1/SET NAMES utf8/g' -i db.dump
sed -e 's/CHARSET=latin1/CHARSET=utf8 COLLATE=utf8_unicode_ci/g' -i db.dump
# Create a new database with the correct parameters.
create database db character set utf8 collate utf8_unicode_ci;
# Verify it.
show create database db;
# Pipe the converted database dump into MySQL.
mysql -h hostname --default-character-set=utf8 -u root -p db < db.dump'Linux' 카테고리의 다른 글
| http 2.4에서 Forbidden You don't have permission to access 해결방법 (0) | 2022.03.17 |
|---|---|
| http2.4에서 html 파일 소스가 보일때 php처리 적용 방법 (0) | 2022.03.17 |
| KT-cloud CentOS7에 MySQL 4 소스컴파일( 실패 ) (1) | 2022.03.05 |
| KT-Cloud LVM 디스크 생성(추가) 확장 요약 (최종) (0) | 2022.01.31 |
| KT cloud 하드디스크 추가 하는법 Linux (0) | 2022.01.30 |