[Magento 2.4.3] SQLSTATE[HY000]: General error: 1419 You do not have the SUPER privilege and binary logging is enabled in setup:performance:generate-fixtures – Solved

Background:

Run below commander in Magento CLI

php bin/magento setup:performance:generate-fixtures -s setup/performance-toolkit/profiles/ce/small.xml

Error msg:

Generating profile with following params:
 |- Admin Users: 50
 |- Websites: 1
 |- Store Groups Count: 1
 |- Store Views Count: 1
 |- Categories: 30
 |- Attribute Sets (Default): 3
 |- Attribute Sets (Extra): 10
 |- Simple products: 800
 |- Configurable products: 16
 |- Product images: 100, 3 per product
 |- Customers: 200
 |- Cart Price Rules: 20
 |- Catalog Price Rules: 20
 |- Coupon Codes: 20
 |- Orders: 80
Config Changes...  done in 00:00:00
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_entity_after_insert AFTER INSERT ON catalog_category_entity FOR EACH ROW
BEGIN
INSERT IGNORE INTO `catalog_category_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
END


How to fix

run in MySQL with root user

set global log_bin_trust_function_creators=1;

Refrence Link:

bitnami community

stackexchange magento

[Solved]Magento install with docker MySql 8 error connect refuse 数据库拒绝链接错误

问题点:

数据库的加密方式( caching_sha2_password )问题造成的。

当然,你有义务去检查的账号密码,至少在命令行里可以正常使用。还有mysql.user的host里是 %(代表已开启远程链接)。

参考链接 中第四点

select host,user,plugin,authentication_string from mysql.user;

看下plugin的加密方式,mysql 8 之后使用了caching_sha2_password,而非比较传统的mysql_native_password,所以如下更新

ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';  ### 把root改成123456 mysql的登录密码
flush privileges; ### 刷新生效

这样子,root就可以链接了,更好的做法是选择你相应的数据库user 而不是root。

此外,版本低于12的Navicat可以连接了。

当然,此外是否配置了正确的端口映射/防火墙等其他问题,也是需要注意。