mysql -uzabbix -p zabbix < database/mysql/schema.sql
Enter password:
ERROR 1419 (HY000) at line 2290: 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)
这是 Zabbix 6.4 在 MySQL 8.x 或开启了二进制日志(log_bin)的情况下常见的报错:
ERROR 1419 (HY000) at line 2290: 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)
错误原因
SQL 文件中有 存储函数或触发器
MySQL 开启了 二进制日志(binary logging)
默认情况下,创建函数/触发器需要 SUPER 权限
如果不想赋 SUPER 权限,可以设置 MySQL 系统变量:
log_bin_trust_function_creators=1
这表示允许 普通用户创建函数/触发器,更安全,也不用授予 SUPER 权限。
解决方法
临时修改变量(推荐)
登录 MySQL(root 用户):
mysql -uroot -p
执行:
— 临时允许普通用户创建函数/触发器
SET GLOBAL log_bin_trust_function_creators = 1;
EXIT;