MySQL复制需要注意的参数

错误相关提示:

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)' on query.

分析:
根据系统提示,导致该错误的原因可能是一个安全设置方面的配置,查手册log_bin_trust_function_creators参数缺省0,是不允许function的同步的。
一般我们在配置repliaction的时候,都忘记关注这个参数,这样在master更新funtion后,slave就会报告错误,然后slave stoped。
处理过程:
登陆mysql数据库
mysql > set global log_bin_trust_function_creators =1;

另外如果主库有event在运行的话还要把下面参数修改:

mysql> show global variables like '%event%';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| event_scheduler | ON |
+-----------------+-------+
1 row in set (0.00 sec)

[@more@]

请使用浏览器的分享功能分享到微信等