phpmyadmin에서도 수정 가능하도록
php 에서
mysql_query("set session character_set_connection=utf8;");
mysql_query("set session character_set_results=utf8;");
mysql_query("set session character_set_client=utf8;");
를 적용하고, 서버에서도 완전하게
mysql -u root -p
msyql> set character_set_client = utf8;
msyql> set character_set_connection = utf8;
msyql> set character_set_database = utf8;
msyql> set character_set_results = utf8;
msyql> set character_set_server = utf8;
mysql> set collation_connection = utf8_general_ci;
mysql> set collation_database = utf8_general_ci;
mysql> set collation_server = utf8_general_ci;
적용 시킨다.
mysql> show variables like 'c%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
| collation_connection | utf8_general_ci |
| collation_database | utf8_general_ci |
| collation_server | utf8_general_ci |
| completion_type | NO_CHAIN |
| concurrent_insert | AUTO |
| connect_timeout | 10 |
+--------------------------+----------------------------+
14 rows in set (0.00 sec)
댓글 달기