-- Build and conf details [umshastr@hod03]/export/umesh/server/binaries/mysql-5.5.45: cat docs/INFO_SRC commit: 4c915b63199d592b5406044d09a18016730498b1 date: 2015-06-25 15:04:44 +0200 build-date: 2015-06-25 15:37:56 +0200 short: 4c915b6 branch: mysql-5.5.45-release MySQL source 5.5.45 #Master [mysqld] user = root pid-file = /export/umesh/server/binaries/mysql-5.5.45/run/master.pid socket = /export/umesh/server/binaries/mysql-5.5.45/run/master.sock log-error=/export/umesh/server/binaries/mysql-5.5.45/log/master.log slow_query_log_file=/export/umesh/server/binaries/mysql-5.5.45/log/slow.log general_log_file=/export/umesh/server/binaries/mysql-5.5.45/log/general.log port = 15000 server-id = 1 basedir = /export/umesh/server/binaries/mysql-5.5.45 datadir = /export/umesh/server/binaries/mysql-5.5.45/master tmpdir = /tmp log-bin = /export/umesh/server/binaries/mysql-5.5.45/log/master-bin log-bin-index = /export/umesh/server/binaries/mysql-5.5.45/log/master-bin.index binlog_format=STATEMENT #Slave [mysqld] user = root pid-file = /export/umesh/server/binaries/mysql-5.5.45/run/slave.pid socket = /export/umesh/server/binaries/mysql-5.5.45/run/slave.sock log-error=/export/umesh/server/binaries/mysql-5.5.45/log/slave.log port = 15001 server-id = 2 basedir = /export/umesh/server/binaries/mysql-5.5.45 datadir = /export/umesh/server/binaries/mysql-5.5.45/slave tmpdir = /tmp relay-log-index = /export/umesh/server/binaries/mysql-5.5.45/log/slave-relay-bin.index relay-log = /export/umesh/server/binaries/mysql-5.5.45/log/slave-relay-bin binlog_format=STATEMENT log_slow_slave_statements=ON slow_query_log=ON long_query_time=0 -- Bring up 2 nodes, and setup master/slave replication [umshastr@hod03]/export/umesh/server/binaries/mysql-5.5.45: ./scripts/mysql_install_db --defaults-file=./master.cnf [umshastr@hod03]/export/umesh/server/binaries/mysql-5.5.45: ./scripts/mysql_install_db --defaults-file=./slave.cnf [umshastr@hod03]/export/umesh/server/binaries/mysql-5.5.45: bin/mysqld_safe --defaults-file=./master.cnf & [umshastr@hod03]/export/umesh/server/binaries/mysql-5.5.45: bin/mysqld_safe --defaults-file=./slave.cnf & -- master [umshastr@hod03]/export/umesh/server/binaries/mysql-5.5.45: bin/mysql -uroot -p -S /export/umesh/server/binaries/mysql-5.5.45/run/master.sock Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.5.45-log MySQL Community Server (GPL) Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> prompt master>; PROMPT set to 'master>' master> master>CREATE USER 'repl'@'localhost' IDENTIFIED BY 'slavepass'; Query OK, 0 rows affected (0.00 sec) master>GRANT REPLICATION SLAVE ON *.* TO 'repl'@'localhost'; Query OK, 0 rows affected (0.00 sec) master> master>CREATE USER 'repl'@'127.0.0.1' IDENTIFIED BY 'slavepass'; Query OK, 0 rows affected (0.00 sec) master>GRANT REPLICATION SLAVE ON *.* TO 'repl'@'127.0.0.1'; Query OK, 0 rows affected (0.00 sec) master>FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec) master>show master status; +-------------------+----------+--------------+------------------+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | +-------------------+----------+--------------+------------------+ | master-bin.000003 | 666 | | | +-------------------+----------+--------------+------------------+ 1 row in set (0.00 sec) master> -- Enable log_bin_trust_function_creators master> set global log_bin_trust_function_creators=ON; Query OK, 0 rows affected (0.00 sec) -- slave [umshastr@hod03]/export/umesh/server/binaries/mysql-5.5.45: bin/mysql -uroot -p -S /export/umesh/server/binaries/mysql-5.5.45/run/slave.sock Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.5.45-log MySQL Community Server (GPL) Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> prompt slave>; PROMPT set to 'slave>' slave>CHANGE MASTER TO -> MASTER_HOST='localhost', -> MASTER_PORT=15000, -> MASTER_USER='repl', -> MASTER_PASSWORD='slavepass', -> MASTER_LOG_FILE='master-bin.000003', -> MASTER_LOG_POS=666; Query OK, 0 rows affected (0.00 sec) slave>start slave; Query OK, 0 rows affected (0.00 sec) slave>show slave status\G *************************** 1. row *************************** Slave_IO_State: Waiting for master to send event Master_Host: localhost Master_User: repl Master_Port: 15000 Connect_Retry: 60 Master_Log_File: master-bin.000003 Read_Master_Log_Pos: 666 Relay_Log_File: slave-relay-bin.000002 Relay_Log_Pos: 254 Relay_Master_Log_File: master-bin.000003 Slave_IO_Running: Yes Slave_SQL_Running: Yes Replicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: Last_Errno: 0 Last_Error: Skip_Counter: 0 Exec_Master_Log_Pos: 666 Relay_Log_Space: 410 Until_Condition: None Until_Log_File: Until_Log_Pos: 0 Master_SSL_Allowed: No Master_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master: 0 Master_SSL_Verify_Server_Cert: No Last_IO_Errno: 0 Last_IO_Error: Last_SQL_Errno: 0 Last_SQL_Error: Replicate_Ignore_Server_Ids: Master_Server_Id: 1 1 row in set (0.00 sec) slave> -- master master>grant usage,select,create routine,execute on test.* to 'miguel'@'%' with grant option; Query OK, 0 rows affected (0.00 sec) master>flush privileges; Query OK, 0 rows affected (0.00 sec) master>\q Bye -- Connected user miguel from workbench session and executed below statements CREATE FUNCTION hello (s CHAR(20)) RETURNS CHAR(50) DETERMINISTIC RETURN CONCAT('Hello, ',s,'!'); ^^ 18:22:58 CREATE FUNCTION hello (s CHAR(20)) RETURNS CHAR(50) DETERMINISTIC RETURN CONCAT('Hello, ',s,'!') 0 row(s) affected, 1 warning(s): 1404 Failed to grant EXECUTE and ALTER ROUTINE privileges 0.343 sec GRANT EXECUTE on FUNCTION hello TO 'yyy'@'%'; ^^ 18:23:20 GRANT EXECUTE on FUNCTION hello TO 'yyy'@'%' Error Code: 1410. You are not allowed to create a user with GRANT 0.359 sec -- slave slave>show slave status\G *************************** 1. row *************************** Slave_IO_State: Waiting for master to send event Master_Host: localhost Master_User: repl Master_Port: 15000 Connect_Retry: 60 Master_Log_File: master-bin.000003 Read_Master_Log_Pos: 1228 Relay_Log_File: slave-relay-bin.000002 Relay_Log_Pos: 699 Relay_Master_Log_File: master-bin.000003 Slave_IO_Running: Yes Slave_SQL_Running: No Replicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: Last_Errno: 0 Last_Error: Query caused different errors on master and slave. Error on master: message (format)='You are not allowed to create a user with GRANT' error code=1410 ; Error on slave: actual message='no error', error code=0. Default database: 'test'. Query: 'GRANT EXECUTE on FUNCTION hello TO 'yyy'@'%'' Skip_Counter: 0 Exec_Master_Log_Pos: 1111 Relay_Log_Space: 972 Until_Condition: None Until_Log_File: Until_Log_Pos: 0 Master_SSL_Allowed: No Master_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master: NULL Master_SSL_Verify_Server_Cert: No Last_IO_Errno: 0 Last_IO_Error: Last_SQL_Errno: 0 Last_SQL_Error: Query caused different errors on master and slave. Error on master: message (format)='You are not allowed to create a user with GRANT' error code=1410 ; Error on slave: actual message='no error', error code=0. Default database: 'test'. Query: 'GRANT EXECUTE on FUNCTION hello TO 'yyy'@'%'' Replicate_Ignore_Server_Ids: Master_Server_Id: 1 1 row in set (0.00 sec)