# \--log-bin-trust-function-creators=1 percona master-master cluster -\> safe?

**URL:** <https://forums.percona.com/t/log-bin-trust-function-creators-1-percona-master-master-cluster-safe/4311>\
**Category:** Percona XtraDB Cluster 5.x\
**Created:** [July 16, 2015, 2:47am UTC](https://forums.percona.com/t/log-bin-trust-function-creators-1-percona-master-master-cluster-safe/4311 "2015-07-16T02:47:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Denny](https://avatars.discourse-cdn.com/v4/letter/d/9de053/32.png) [@Denny](https://forums.percona.com/u/Denny)\
**Post date:** [July 16, 2015, 2:47am UTC](https://forums.percona.com/t/log-bin-trust-function-creators-1-percona-master-master-cluster-safe/4311/1 "2015-07-16T02:47:54Z")

</div>

hi,

one of our web application (I-DOIT) wants to create a function:

Database error : Query error: ’  
CREATE FUNCTION alphas(str CHAR(100)) RETURNS CHAR(100) DETERMINISTIC READS SQL DATA  
BEGIN  
DECLARE i, len SMALLINT DEFAULT 1;  
DECLARE ret CHAR(100) DEFAULT ‘’;  
DECLARE c CHAR(1);  
SET len = CHAR\_LENGTH( str );  
REPEAT  
BEGIN  
SET c = MID( str, i, 1 );  
IF c REGEXP ‘[[:alpha:]]’ THEN  
SET ret=CONCAT(ret,c);  
END IF;  
SET i = i + 1;  
END;  
UNTIL i \> len END REPEAT;  
RETURN ret;  
END’:  
You do not have the SUPER privilege and binary logging is enabled (you _might_ want to use the less safe log\_bin\_trust\_function\_creators variable)

is it save to enable the variable on all nodes? The application connects via HAproxy the cluster (roundrobin).

============================== =  
[…]

# GENERAL

port = 3306  
user = mysql  
default-storage-engine = InnoDB  
socket = /var/lib/mysql/mysql.sock  
pid-file = /var/lib/mysql/mysql.pid

# MUST DO UTF8

collation-server = utf8\_unicode\_ci  
character-set-server = utf8  
init\_connect = ‘SET NAMES utf8, collation\_connection=utf8\_unicode\_ci’

# MyISAM

key-buffer-size = 32M  
myisam-recover = FORCE,BACKUP

# SAFETY

max-allowed-packet = 25M  
max-connect-errors = 1000000  
skip-name-resolve  
#sql-mode = ERROR\_FOR\_DIVISION\_BY\_ZERO,NO\_AUTO\_CREATE\_USER,NO\_AUTO\_VALUE\_ON\_ZERO,NO\_ZERO\_DATE,NO\_ZERO\_IN\_DATE,ONLY\_FULL\_GROUP\_BY  
sql-mode = NO\_ENGINE\_SUBSTITUTION

# dekativiert, wegen i-doit

innodb-strict-mode = 0

# DATA STORAGE

datadir = /var/lib/mysql/

# BINARY LOGGING

binlog\_format = ROW  
log-bin = /var/lib/mysql/mysql-bin  
expire-logs-days = 2  
max\_binlog\_size = 100M  
sync-binlog = 1

# CACHES AND LIMITS

tmp-table-size = 32M  
max-heap-table-size = 32M  
query-cache-type = 0  
query-cache-size = 0  
max-connections = 500  
thread-cache-size = 50  
open-files-limit = 65535  
table-definition-cache = 4096  
table-open-cache = 4096

# INNODB

innodb-flush-method = O\_DIRECT  
innodb-log-files-in-group = 2  
innodb-log-file-size = 256M  
innodb-flush-log-at-trx-commit = 1  
innodb-file-per-table = 1  
innodb-buffer-pool-size = 6G  
innodb\_autoinc\_lock\_mode = 2

# LOGGING

log-error = /var/lib/mysql/mysql-error.log  
log-queries-not-using-indexes = 1  
slow-query-log = 1  
slow-query-log-file = /var/lib/mysql/mysql-slow.log

# Cluster Configuration

wsrep\_provider = /usr/lib/galera2/libgalera\_smm.so  
wsrep\_provider\_options = “pc.ignore\_sb = yes; gcache.size=2G; gcache.page\_size=1G”  
wsrep\_cluster\_name = “XtraDB\_Cluster”  
wsrep\_sst\_method = xtrabackup-v2  
wsrep\_slave\_threads = 16  
wsrep\_sst\_auth = “sstuser:secret”  
wsrep\_cluster\_address = “gcomm://…”

[sst]  
streamfmt = xbstream

# !includedir /etc/mysql/conf.d/

cu denny
