You can try to change log_bin_trust_function_creators
; however, there is an alternative approach that seems more appropriate when you consider the meaning of that variable:
It controls whether stored function creators can be trusted not to create stored functions that will cause unsafe events to be written to the binary log.
A setting of 0
also enforces the restriction that a function must be declared with the DETERMINISTIC
characteristic, or with the READS SQL DATA
or NO SQL
characteristic. If the variable is set to 1
, MySQL does not enforce these restrictions on stored function creation.
All that option does is assume that you know what you are doing, without making you assert that you do by using one of the three characteristics in your CREATE
statement... but if you don't properly declare the function, you may miss out on potential optimizations.
misdeclaring a routine might affect results or affect performance
Taken together, this implies that the most correct approach is to declare your stored functions with DETERMINISTIC
or READS SQL DATA
or NO SQL
as appropriate, and, if these do not correctly describe your function's behavior, then your function still may result in unsafe statements being written to the binary log, because these options are also "trusted:"
Assessment of the nature of a routine is based on the “honesty” of the creator: MySQL does not check that a routine declared DETERMINISTIC
is free of statements that produce nondeterministic results.
Curious aside: astute observers will note that I omitted something from the documentation's description:
If set to 0 (the default), users are not permitted to create or alter stored functions unless they have the SUPER
privilege in addition to the CREATE ROUTINE
or ALTER ROUTINE
privilege.
Since nobody gets SUPER
in RDS, and assuming this is not an error in the official documentation, this seems like it must be an AWS customization of MySQL behavior.
The InnoDB Storage Engine has too many moving parts to just allow the buffer pool to be resized on the fly because the buffer pool interacts with system tablespace (ibdata1) and the transactions logs (ib_logfile0, ib_logfile1).
In spite of the MySQL Documentation, you can change the effect of log-bin
using another variable called SQL_LOG_BIN
. Look at the effects:
SESSION
If you run
SET SQL_LOG_BIN = 0;
this will disable your DB Session from recording binlog events.
If you run
SET GLOBAL SQL_LOG_BIN = 0;
this will disable all incoming DB Sessions from recording binlog events.
General Log / Slow Log
As a DBA, I am very glad that the general log and slow log are dynamic. Otherwise
- how could do perform any log rotation ?
- how to stop these logs before diskspace runs out ?
Here are some posts I made about doing log rotations
Datetime Format
mysqld is usually cognizant of timezone and internalization of datetime displays. I do not see a beneficial reason for shifting the datetime format on demand. This may actual cause problems, not so much with mysqld, but with PHP/Python/Ruby scripts that read dates from the MySQL instance and may misinterpret '04/12/2013' as April 12th when it should be Dec 4th. That would be developer's nightmare to deal with. Having datetime format a read-only variable simply provides a safety net against such a death-defying move whereas proper planning of the database and code interoperability with dates would be in order.
Best Answer
With regard to SUPER and TRIGGER privileges, you need the TRIGGER privilege to create triggers on tables you have rights for.
If you play binlogs, there is the possibility of seeing commands to create triggers on tables you do not have rights for. This is implied from the MySQL Documentation:
With regard to your second point
There are occasions when certain SELECTs on a Master may yield different results on a Slave. For example, let's say you ran this query on a a MASTER
How could a SLAVE produce different results?
If you have a several hundred INSERTs commands occur on a Master, they get serialized in the Binary Logs. Even if a DB Connection 1 completes an INSERT before DB Connection 2, it is possible for DB Connection 2 to write its event in the Master's Binary Logs before DB Connection 1. This is particularly true in a write-intensive, heavy OLAP environment. This would make a Slave's copy of
tbl
physically out-of-sync with its Master. Running queries can hide this.OK, you are probably thinking it's just a SELECT.
SELECTs are not in Binary Logs. INSERTs, DELETEs, and UPDATEs are.
Did you know you could do a query like this ?
Replicating this can really make
tbl
out of sync.Stored Functions can also have this headache if it the code within it is not
DETERMINISTIC
. This is why log_bin_trust_function_creators was invented. This alleviates mysqld of the responsibility of figuring out if data operations are synchronized in terms of replication. Yes, they fudged their way around downstream replication issues.