2009-03-30
centos5、Q4Mをコンパイルした記録
注意
Q4M0.8.4+MySQL5.1.32のくみあわせだとバグがあるっぽいです。バイナリログ無効にしないといけません。
環境
参考サイト
棚からパルチャギが大変参考になりました。なかったら無理だった。
やりかた
結論としては、configureのパラメータはこう。
CPPFLAGS=`mysql_config --cflags` LDFLAGS=`mysql_config --libs` ./configure --prefix=/usr --with-mysql=/usr/src/redhat/SOURCES/mysql-5.1.32 --includedir=/usr/include
CPPFLAGS,LDFLAGSの設定をMySQLとあわせるためmysql_configコマンドで取得してる(CFLAGSはつかってないっぽい)。MySQLのprefixは/usr。--with-mysqlでMySQLのソースの場所を指定。--includeを指定しないとmy_config.hがみつからないエラーになる。
これでmakeしたらコンパイル通りました。
make installするとlibqueue-engine.soが/usr/libに作成されるが、MySQLのプラグインディレクトリは/usr/lib64/mysql/pluginなので手動で移動してやる。
これでinstall.sqlに成功する。
make testにはperl-DBD-なんとかが必要なのだがそのインストールも面倒……
perl方面に疎くて苦戦したけど、結論としてはsudo cpanしてinstall DBD::mysqlするだけ。
他にもいくつか必要なCPAN moduleがある。ここ参照。
あたり。
で、いざテストを走らせてみると
# Failed test at t/01-base.t line 24.DBD::mysql::db do failed: Binary logging not possible. Message: Statement cannot be logged to the binary log in row-based nor statement-based format at t/01-base.t line 25. # Failed test at t/01-base.t line 24.DBD::mysql::db do failed: Binary logging not possible. Message: Statement cannot be logged to the binary log in row-based nor statement-based format at t/01-base.t line 25. # Failed test at t/01-base.t line 24.DBD::mysql::db do failed: Binary logging not possible. Message: Statement cannot be logged to the binary log in row-based nor statement-based format at t/01-base.t line 25. # Failed test at t/01-base.t line 24.DBD::mysql::db do failed: Binary logging not possible. Message: Statement cannot be logged to the binary log in row-based nor statement-based format at t/01-base.t line 25. # Failed test at t/01-base.t line 24.DBD::mysql::db do failed: Binary logging not possible. Message: Statement cannot be logged to the binary log in row-based nor statement-based format at t/01-base.t line 25.
ヒッ……
Q4Mチュートリアルの例でも
mysql> CREATE TABLE my_queue (v1 int not null, v2 varchar(255)) ENGINE=queue; Query OK, 0 rows affected (0.01 sec) mysql> INSERT INTO my_queue (v1, v2) VALUES (3, "hello world!"); ERROR 1598 (HY000): Binary logging not possible. Message: Statement cannot be logged to the binary log in row-based nor statement-based format
queueへのinsertができないようだ(queue_waitとかは可能)
この現象はバイナリログを無効化することで回避できる(コメントで教えていただきました。thx)。実用的にはqueueにinsertするコネクションの使用前に
SET SQL_LOG_BIN=0
すればOK。なんか権限いるみたいだけど。
ランタイムにグローバルに変更する方法がわからなかったので、make testの際にはmy.confの
log-bin=mysql-bin
- 68 http://www.google.co.jp/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CCYQFjAA&url=http://d.hatena.ne.jp/gnarl/20090330/1238339568&ei=9-ofT87-LfChiAeAu-2ZDQ&usg=AFQjCNF_rnUupSH5mJh1WWKWgXOgB8pjqw&sig2=Dt8G7w9YliK2LIj9hv1JlA
- 48 https://www.google.co.jp/
- 40 http://reader.livedoor.com/reader/
- 35 http://www.google.co.jp/search?hl=ja&client=firefox-a&rls=org.mozilla:ja:official&hs=R05&newwindow=1&q=q4m+コンパイル エラー&btnG=検索&lr=lang_ja
- 24 http://b.hatena.ne.jp/entry/d.hatena.ne.jp/gnarl/20090330/1238421444
- 24 http://www.google.co.jp/search?q=Binary+logging+not+possible.+Message:+Statement+cannot+be+logged+to+the+binary+log+in+row-based+nor+statement-based+format&lr=lang_ja&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:ja:official&client=firefox-a
- 22 http://d.hatena.ne.jp/
- 19 http://www.google.co.jp/search?sourceid=chrome&ie=UTF-8&q=Binary+logging+not+possible.+Message:+Statement+cannot+be+logged+to+the+binary+log+in+row-based+nor+statement-based+format
- 18 http://twitter.com/todesking
- 15 http://www.google.co.jp/url?sa=t&source=web&cd=1&ved=0CBkQFjAA&url=http://d.hatena.ne.jp/gnarl/20090330/1238421444&rct=j&q=sastruts statuscode&ei=07_BTYzgGYycvgOQ5LioBA&usg=AFQjCNFfM4d-kp-AyCVOe5AmlQVo8cUa-g&sig2=Fssben_ZJNxrRo6EfX3XSA
