Magento 2 Fix “General error: 1419 You do not have the SUPER privilege and binary logging is enabled”

October 30th, 2021





Sometimes when reindexing or recompiling, I was getting the following error:

SQLSTATE[HY000]: General error: 1419 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), query was: CREATE TRIGGER trg_catalog_category_product_after_insert AFTER INSERT ON catalog_category_product FOR EACH ROW
BEGIN
INSERT IGNORE INTO `catalogrule_product_cl` (`entity_id`) VALUES (NEW.`product_id`);
END

The solution was quite simple, login as the root user or a user with the SUPER privilege and run the following command:

 
SET GLOBAL log_bin_trust_function_creators = 1;

After that, you should be able to rerun your DI compile or whatever command was creating that error.


Comments

3 thoughts on "Magento 2 Fix “General error: 1419 You do not have the SUPER privilege and binary logging is enabled”"

  1. Clem says:

    Thanks a lot, it solved my problem too.

  2. Carlos says:

    This resolved my problem with a migration from mysql 5.7 to 8.0. A magento2 web store using the DB was showing this error/warning during upgrades. Ran your fix on MySQL selecting that DB in question and it solved the problem. Thanks!

    1. joeybab3 says:

      Awesome, glad to hear it helped!

Leave a Reply

Your email address will not be published. Required fields are marked *