[MySQL] Encoding 관련 Parameters

* Client characterset, Server characterset

mysql> status

————–

mysql  Ver 14.14 Distrib 5.1.41, for debian-linux-gnu (x86_64) using readline 6.1

Connection id:          72

SSL:                    Not in use

Current pager:          stdout

Using outfile:          ”

Using delimiter:        ;

Server version:         5.1.41-3ubuntu12.10 (Ubuntu)

Protocol version:       10

Connection:             Localhost via UNIX socket

Client characterset:    latin1

Server characterset:    latin1

UNIX socket:            /var/run/mysqld/mysqld.sock

Uptime:                 39 sec

Threads: 1  Questions: 259  Slow queries: 0  Opens: 231  Flush tables: 1  Open tables: 56  Queries per second avg: 6.641

————–

mysql> 

* /etc/mysql/my.cnf [client]

[mysqld]
default-character-set = utf8

 

mysql> show variables like ‘%char%’;

+————————–+—————————-+

| Variable_name            | Value                      |

+————————–+—————————-+

| character_set_client     | latin1                     |

| character_set_connection | latin1                     |

| character_set_database   | utf8                       |

| character_set_filesystem | binary                     |

| character_set_results    | latin1                     |

| character_set_server     | utf8                       |

| character_set_system     | utf8                       |

| character_sets_dir       | /usr/share/mysql/charsets/ |

+————————–+—————————-+

8 rows in set (0.00 sec)

mysql>

* Database

mysql> ALTER DATABASE reviewdb DEFAULT charset=utf8;

* Table 및 Column

mysql> ALTER TABLE `reviewdb`.`patch_comments` MODIFY COLUMN `message` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL;

mysql> ALTER TABLE `reviewdb`.`change_messages` MODIFY COLUMN `message` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL;

mysql> ALTER TABLE `reviewdb`.`account_groups` MODIFY COLUMN `name` VARCHAR(255)  CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;

mysql> ALTER TABLE `reviewdb`.`account_group_names` MODIFY COLUMN `name` VARCHAR(255)  CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;

mysql> ALTER TABLE `reviewdb`.`accounts` MODIFY COLUMN `full_name` VARCHAR(255)  CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL;

mysql> ALTER TABLE `reviewdb`.`accounts` MODIFY COLUMN `preferred_email` VARCHAR(255)  CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL;

mysql> ALTER TABLE `reviewdb`.`account_external_ids` MODIFY COLUMN `email_address` VARCHAR(255)  CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL;

mysql> ALTER TABLE `reviewdb`.`account_groups` MODIFY COLUMN `description` TEXT  CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL;

mysql> ALTER TABLE `reviewdb`.`projects` MODIFY COLUMN `description` TEXT  CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL;

mysql> ALTER TABLE `reviewdb`.`projects` MODIFY COLUMN `name` VARCHAR(255)  CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;

 

[git] git 설정하기

1. git 설치

sudo apt-get install build-dep git-core git-doc

2. git 구성하기
2.1. username과 email 설정

git config –global user.name “Yang Jeong-Seok”
git config –global user.email “dasomoli@gmail.com

2.2.. git 설정 확인

git config –global –list

2.3.. git color ui 사용

git config –global color.ui “auto”

2.4. 기본 인코딩을 cp949로 바꾸기

git config –global i18n.commitEncoding cp949
git config –global i18n.logOutputEncoding cp949

윈도에서는 LESSCHARSET=latin1 으로 설정해야 로그 메시지를 볼 수 있다.

set LESSCHARSET=latin1

2.5. 기본 에디터를 vim 으로 설정하기

git config –global core.editor “vim”