mysql作成関数の問題


mysql作成関数の問題(回転)
2010-05-26 19:37
今日、データを整理する时、またMySQL関数が作成できない问题に出会って、以前も何度も出会って、解决は解决しましたが、解决方法はいつも覚えられなくて、よく书いていません.
エラーメッセージはほぼ同じです.
ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
関数は作成できません.非オープン機能です.
SQL code

       
mysql > show variables like ' %func% ' ; + -- -------------------------------+-------+ | Variable_name | Value | + -- -------------------------------+-------+ | log_bin_trust_function_creators | OFF | + -- -------------------------------+-------+ 1 row in set ( 0.00 sec) mysql > set global log_bin_trust_function_creators = 1 ; Query OK, 0 rows affected ( 0.00 sec) mysql > show variables like ' %func% ' ; + -- -------------------------------+-------+ | Variable_name | Value | + -- -------------------------------+-------+ | log_bin_trust_function_creators | ON | + -- -------------------------------+-------+ 1 row in set ( 0.00 sec) mysql >

次は別の解決策です
分析:
システムのヒントに従って、このエラーの原因は安全設定の構成である可能性があります.マニュアルのlog_を調べます.bin_trust_function_creatorsパラメータのデフォルト0はfunctionの同期を許可しません
.
一般的にrepliactionを構成するときは、このパラメータに注目することを忘れます.masterがfuntionを更新すると、slaveはエラーを報告し、slave stopedになります.
プロセス:
mysqlデータベースにログイン
> set global log_bin_trust_function_creators = 1;
> start slave;
mysqlの起動ログを追跡し、slaveが正常に動作し、問題が解決します.
追跡を続け、bin-relay-logのデータは一晩ですべて同期しました.直接my.cnfに追加
log_bin_trust_function_creators = 1
これで後で再起動すると自動的にオンになります.