mysql覚書


※上記の広告は60日以上更新のないWIKIに表示されています。更新することで広告が下部へ移動します。

デフォルト
mysql> status
--------------
mysql  Ver 14.12 Distrib 5.0.45, for Win32 (ia32)
Server characterset:    sjis
Db     characterset:    sjis
Client characterset:    sjis
Conn.  characterset:    sjis

mysql> show variables like '%char%';
+--------------------------+------------------------------+
| Variable_name            | Value                        |
+--------------------------+------------------------------+
| character_set_client     | sjis                         |
| character_set_connection | sjis                         |
| character_set_database   | sjis                         |
| character_set_filesystem | binary                       |
| character_set_results    | sjis                         |
| character_set_server     | sjis                         |
| character_set_system     | utf8                         |
| character_sets_dir       | H:\mysql\share\charsets\ |
+--------------------------+------------------------------+

文字コードセット(ujis)
mysql> set names ujis;
mysql> status
Server characterset:    sjis
Db     characterset:    sjis
Client characterset:    ujis<--変化
Conn.  characterset:    ujis<--変化

mysql> show variables like '%char%';
+--------------------------+--------------------------+
| Variable_name            | Value                    |
+--------------------------+--------------------------+
| character_set_client     | ujis                     |<--変化
| character_set_connection | ujis                     |<--変化
| character_set_database   | sjis                     |
| character_set_filesystem | binary                   |
| character_set_results    | ujis                     |<--変化
| character_set_server     | sjis                     |
| character_set_system     | utf8                     |
| character_sets_dir       | H:\mysql\share\charsets\ |
+--------------------------+--------------------------+