mysql - 无法在 Azure mySQL 中创建函数/存储过程
问题描述
我刚刚使用 Azure 设置了一个 mysql 数据库,我正在使用 Navicat 连接到它,一切正常。我现在正在尝试创建一些函数和存储过程,但出现超级用户错误:
您没有超级权限并且启用了二进制日志记录(您可能希望使用不太安全的 log_bin_trust_function_creators 变量)> 时间:0.027s
这是我其中之一的代码:
CREATE function `triggertradersazure`.`sf_entity_active_sub`(`p_entity_id` INT)
returns INT(11)
DETERMINISTIC
begin
IF EXISTS (SELECT 1
FROM tbl_stripe_customer_link_sub sc
JOIN tbl_stripe_sub_payments ss
ON sc.stripe_customer_id = ss.stripe_customer_id
AND ss.stripe_subscription_id =
sc.stripe_subscription_id
WHERE active = 'Y'
AND entity_id = p_entity_id) THEN
RETURN 1;
ELSE
RETURN 0;
end IF;
end;
用户信息来自mql.user
:
INSERT INTO `mysql`.`user`
(`host`, `user`, `password`, `select_priv`, `insert_priv`, `update_priv`, `delete_priv`, `create_priv`, `drop_priv`, `reload_priv`, `shutdown_priv`, `process_priv`, `file_priv`, `grant_priv`, `references_priv`, `index_priv`, `alter_priv`, `show_db_priv`, `super_priv`, `create_tmp_table_priv`, `lock_tables_priv`, `execute_priv`, `repl_slave_priv`, `repl_client_priv`, `create_view_priv`, `show_view_priv`, `create_routine_priv`, `alter_routine_priv`, `create_user_priv`, `event_priv`, `trigger_priv`, `create_tablespace_priv`, `ssl_type`, `ssl_cipher`, `x509_issuer`, `x509_subject`, `max_questions`, `max_updates`, `max_connections`, `max_user_connections`, `plugin`, `authentication_string`, `password_expired`)
VALUES ('%', 'triggertraders', '*', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'N', 'Y', 'N', 'Y', 'Y', 'Y', 'Y', 'Y', 'N', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'N', '', '', '', '', 0, 0, 0, 0, 'mysql_native_password', '', 'N');
此用户没有超级用户,但我不需要它,Azure 不允许它?
目前不知道该怎么办。我的功能有
`CREATE DEFINER = `tiggertraders`@`ip`
我删除了它,因为这是为了解决问题。
任何帮助都会很棒,
谢谢,
解决方案
推荐阅读
- javascript - 如何动态声明本地数据
- javascript - 如何通过网页发送电子邮件
- docker - Docker节点级负载平衡不起作用
- javascript - 如何禁用按钮并显示输入标题
- arrays - 通过指针数组获取输入
- php - Laravel 123 中的数组推送
- reactjs - 将 React Markdown NPM 导入 Codepen 会返回空白页
- javascript - 深度优先搜索的深拷贝对象
- python - Django DRF在自定义装饰器中获取请求查询参数,应用于viewsets.ViewSet中的函数
- javascript - 无法将 Ajax 数据传递到 HTML 表中