かみぽわーる

kamipo's blog

mysqlでクエリのコメントがshow full processlistに表示されないときの対処法

人力検索twitterで聞いたらすぐ解決しました。

# mysql --help|grep comments
  -c, --comments      Preserve comments. Send comments to the server. The
                      default is --skip-comments (discard comments), enable
                      with --comments
comments                          FALSE

ぜんぜん知らなかった…。

どうやらコメントが捨てられるのはshellからmysqlコマンドを使ったときだけで
perlとrubyのDBIと、phpのmysql、mysqli、pdoから試したところコメントは表示されてました。

id:kazuhooku++ id:sh2++