mysql cluster 搭建问题记录

 

问题1、

[root@localhost mysql]# mysql -u 111-p 111<DB_Init.sql

Enter password:

ERROR 1418 (HY000) at line 871: 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)

 

执行导入数据不成功

原因:

我们开启了 bin-log, 我们就必须为我们的function指定一个参数

解决办法:

 

mysql> SET GLOBAL log_bin_trust_function_creators = 1;
Query OK, 0 rows affected (0.00 sec)

 

参考:http://cache.baidu.com/c?m=9d78d513d9881ce84fede52156438d200e54f1266f8b96027fa5d51584642a060631f4bb56644a53c4c50d3956ee084bea817721635437b7ea96d51fcabae23f28fc3035004cdd1d05d269b8cc3232c050d61aaeee5ff0bb802594dac5d2af001496024321ddac9c5b7003cd1be71541b2e6ce1b530250fbfa3014bb0a3772cc7354f107a7ef682841c3e1dc2f51de7a8e3c4480af42b33a13a213d34e467b59f31ffa43562632fd1f79a2112045d4b81bbc7b644022b542b3b9c5b4eb4a8fdee93498fdcbae289560e1d8&p=8b2a9641cddb5be434bd9b780d0a97&user=baidu

 

 

问题2、

程序在执行数据库语句时失败

 

java.sql.SQLException: General error message from server: "Binary logging not possible. Message: Transaction level 'READ-COMMITTED' in InnoDB is not safe for binlog mode 'STATEMENT'"

 

原因是由于 read committed与binlog格式关系造成的。

解决方法:

修改binlog格式

mysql>set session binlog_format=row;   改为行格式

mysql>set session binlog_format=mixed; 改为混合格式

或者修改事务

mysql>set session transaction isolation level REPEATABLE READ;

 

我采用的是在配置文件/etc/my.cnf 中修改的

在[mysqld]中添加

binlog_format="MIXED"

 

参考文章:

http://www.phpfans.net/article/htmls/201008/MjkyNTE0.html

http://cache.baidu.com/c?m=9f65cb4a8c8507ed4fece7631045952458438014668cc7150884c013c5234c413037bee43a634a579392613156e91a07b4ed32753c052ab590dccd179ded9d3f5f8830437b0bf63505a31fb8cb37759a7cce07bcb81897ad803884dad1c4ae2744ba25&p=9f3dc459818112a05ebd9b78084e&user=baidu

 

你可能感兴趣的:(sql,c,mysql,SQL Server,cache)