Mysql无法创建函数 错误码: 1418

本文涉及的产品
云数据库 RDS MySQL Serverless,0.5-2RCU 50GB
简介:

在mysql中创建函数,报

错误码: 1418
This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable) 这个是创建函数功能未开。

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show variables like '%func%';
+---------------------------------+-------+
| Variable_name                   | Value |
+---------------------------------+-------+
| log_bin_trust_function_creators | OFF   |
+---------------------------------+-------+
1 row in set (0.01 sec)

mysql> set og_bin_trust_function_creators =1;
ERROR 1193 (HY000): Unknown system variable 'og_bin_trust_function_creators'
mysql> set log_bin_trust_function_creators =1;
ERROR 1229 (HY000): Variable 'log_bin_trust_function_creators' is a GLOBAL variable and should be set with SET GLOBAL
mysql> set global log_bin_trust_function_creators =1;
Query OK, 0 rows affected (0.00 sec)

mysql> show variable like '%func%';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'variable like '%func%'' at line 1
mysql> show variables like '%func%';
+---------------------------------+-------+
| Variable_name                   | Value |
+---------------------------------+-------+
| log_bin_trust_function_creators | ON    |
+---------------------------------+-------+
1 row in set (0.01 sec)

mysql> commit;
Query OK, 0 rows affected (0.00 sec)

mysql>

然后在创建函数即可。

 



本文转自茄子_2008博客园博客,原文链接:http://www.cnblogs.com/xd502djj/archive/2012/09/21/2696913.html,如需转载请自行联系原作者。


相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
相关文章
|
1月前
|
关系型数据库 MySQL 索引
936. 【mysql】locate函数
936. 【mysql】locate函数
18 2
|
1月前
|
SQL 关系型数据库 MySQL
927. 【mysql】coalesce 函数
927. 【mysql】coalesce 函数
19 3
|
1月前
|
关系型数据库 MySQL
926.【mysql】 date 函数
926.【mysql】 date 函数
59 3
|
1月前
|
关系型数据库 MySQL
925. 【mysql】convert 函数
925. 【mysql】convert 函数
23 3
|
1月前
|
SQL 关系型数据库 MySQL
【MySQL 数据库】2、MySQL 的数据控制语言、函数和约束
【MySQL 数据库】2、MySQL 的数据控制语言、函数和约束
28 0
|
3天前
|
SQL 关系型数据库 MySQL
DQL语言之常见函数(mysql)
DQL语言之常见函数(mysql)
|
10天前
|
SQL 关系型数据库 MySQL
mysql多表查询、函数查询
mysql多表查询、函数查询
|
1月前
|
关系型数据库 MySQL 数据库
【mysql】—— 函数的基本介绍
【mysql】—— 函数的基本介绍
|
1月前
|
关系型数据库 MySQL
922.【mysql】if 函数
922.【mysql】if 函数
19 3
|
1月前
|
关系型数据库 MySQL 数据处理
Mysql基础第十四天,使用数据处理函数
Mysql基础第十四天,使用数据处理函数
58 0