Wednesday, November 8, 2023

MySQL: 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)

 For future reference, this is what I did.

When checking the database, I found "log_bin_trust_function_creators" was set to "Off".

Code:
mysql> SHOW VARIABLES LIKE 'log_bin_trust_function_creators';
+---------------------------------+-------+
| Variable_name                   | Value |
+---------------------------------+-------+
| log_bin_trust_function_creators |  OFF  |
+---------------------------------+-------+
Therefore, as suggested by Atsushi , we can simply set it to "On" (1).
Code:
mysql> SET GLOBAL log_bin_trust_function_creators = 1;
The other option is to update the user to Super.
We can see the users Super privileges like this:
Code:
mysql> SELECT Host,User,Super_priv FROM mysql.user;
+-----------+------------------+------------+
| Host      | User             | Super_priv |
+-----------+------------------+------------+
| %         | zabbix1          |     N      |
| %         | zabbix2          |     N      |
| %         | zabbixf          |     N      |
| localhost | mysql.infoschema |     N      |
| localhost | mysql.session    |     Y      |
| localhost | mysql.sys        |     N      |
| localhost | root             |     Y      |
| localhost | zabbixdb         |     N      |
+-----------+------------------+------------+
To set a user as Super, just update the table as shown by adminjerry . ("zabbix1" user as an example)
Code:
UPDATE mysql.user SET Super_Priv='Y' WHERE user='zabbix1' AND host='%';