my.cnfã«ã¯[group]
ã¨ãããªãã·ã§ã³ã°ã«ã¼ããæ¸ãã¦ãã°ã«ã¼ãæ¯ã«è¨å®ãã§ãã¾ãã
ãªãã·ã§ã³ã°ã«ã¼ãã«ã¯ç¹æ®ãª[client]
ã¨ããã®ãããã¾ãã
[client]ãªãã·ã§ã³ã°ã«ã¼ãã¯ããã¹ã¦ã®ã¯ã©ã¤ã¢ã³ãããã°ã©ã (mysqldã¯é¤ãï¼ã«ãã£ã¦è§£èªããã¾ããããã«ãã£ã¦å ¨ã¦ã®ã¯ã©ã¤ã¢ã³ãã«å½ã¦ã¯ã¾ããªãã·ã§ã³ãæå®ãããã¨ãå¯è½ã«ãªãã¾ãã
MySQL :: MySQL 5.6 リファレンスマニュアル :: 4.2.6 オプションファイルの使用
ãªã®ã§[client]
ã«default-character-set = utf8
ã¨æ¸ãã¦ããã°ã(my.cnfã解éãã)å
¨ã¦ã®ã¯ã©ã¤ã¢ã³ãã«default-character-setãã»ãããããã¨ãå¯è½ã§ãã
ã¨ãããdefault-character-setã解ããªãã¯ã©ã¤ã¢ã³ãã®å ´åã¯ã¨ã©ã¼ã«ãªã£ã¦ãã¾ãã¾ããä¾ãã°mysqlbinlogã³ãã³ããããã§ãã
$ mysqlbinlog mysqlbinlog: unknown variable 'default-character-set=utf8'
ãããã£ãã¨ããã loose- ã®åºçªã§ãã
my.cnfã«ã
[client] port = 3306 socket = /var/lib/mysql/mysql.sock loose-default-character-set = utf8
ã¨æ¸ãã¦ããã°OKã§ãã
ã°ã°ãã¨ä»åã®ãããªmysqlbinlogã®åé¡ã®è§£æ±ºæ³ã¨ãã¦mysqlbinlogã«--no-defaults
ãæ·»ãã¦å®è¡ãããã¨ããã®ãæ£è¦ããã¾ããã
- my.cnfã«æ¸ããè¨å®ãå ¨é¨ç¡è¦ããã
- ãã¡ãã¡æå®ããã®ãããã©ã
ã®ã§ãåç½® loose- ã使ã£ãã»ããããããããªããã¨æãã¾ãã