mysqlのdatabaseのパラメータである、”character_set_results”, “character_set_server”
の変更方法を記載します。
文字化けなどの対処方法になるかもしれません。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
mysql> show variables like 'character_set%'; +--------------------------+----------------------------------------+ | Variable_name | Value | +--------------------------+----------------------------------------+ | character_set_client | latin1 | | character_set_connection | latin1 | | character_set_database | latin1 | | character_set_filesystem | binary | | character_set_results | latin1 | | character_set_server | latin1 | | character_set_system | utf8 | | character_sets_dir | /usr/local/mysql/share/mysql/charsets/ | +--------------------------+----------------------------------------+ 8 rows in set (0.00 sec) |
my.cnfに以下を設定するして、mysqldを再起動
1 |
default-character-set=utf8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
mysql> show variables like 'character_set%'; +--------------------------+----------------------------------------+ | Variable_name | Value | +--------------------------+----------------------------------------+ | character_set_client | latin1 | | character_set_connection | latin1 | | character_set_database | latin1 | | character_set_filesystem | binary | | character_set_results | latin1 | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir | /usr/local/mysql/share/mysql/charsets/ | +--------------------------+----------------------------------------+ 8 rows in set (0.00 sec) |
/