mysql函数

mysql创建函数槽点

自闭症网瘾萝莉.ら 提交于 2019-12-27 05:00:00
上机环境 mysql8.0 navicat for mysql 很有那么一批软件程序,要不做点脱了裤子放屁的事儿就觉得自己不够二进制似的,今儿写了一下午mysql函数,怎么都通过不了,上网一看 mysql要想写点函数,先要打开几个参数如下: 开启允许创建函数的参数(援引自 https://blog.csdn.net/weixin_34226706/article/details/86019015 ) 解决办法1: 执行: SET GLOBAL log_bin_trust_function_creators = 1; 不过 重启了 就失效了 注意: 有主从复制的时候 从机必须要设置 不然会导致主从同步失败 解决办法2: 在my.cnf里面设置 log-bin-trust-function-creators=1 不过这个需要重启服务 set global log_bin_trust_function_creators=TRUE; 上面这个设置设置为true我们才能让函数返回任意类型的结果,否则会报 This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary 而我仅仅是写了这样一段函数,用于测试在navicat中能否执行通过! DELIMITER $$

MySQL This function has none of DETERMINISTIC, NO SQL...错误1418 的原因分析及解决方法

旧城冷巷雨未停 提交于 2019-12-27 04:59:42
MySQL 开启bin-log后,调用存储过程或者函数以及触发器时,会出现错误号为1418的错误: ERROR 1418 (HY000): 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) 我本机的错误: {"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)"} [ mysql .Data.MySqlClient.MySqlException]: {"This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its

Mysql遇到的问题总结

空扰寡人 提交于 2019-12-27 04:59:29
1、解决导出csv中文乱码问题: 将csv用txt打开,另存为,选择utf8编码即可。 解决导入问题: mysql安装目录下的my.ini,增加如下参数: [client] default-character-set=utf8 [mysqld] default-storage-engine=INNODB character-set-server=utf8 collation-server=utf8_general_ci 重启mysql服务。 2.执行脚本文件命令 psql -d nyc_data -U postgres \i D:/devices_small/devices.sql 3 MySQL This function has none of DETERMINISTIC 解决办法也有两种, 第一种是在创建子程序(存储过程、函数、触发器)时,声明为DETERMINISTIC或NO SQL与READS SQL DATA中的一个, 例如: CREATE DEFINER = CURRENT_USER PROCEDURE `NewProc`() DETERMINISTIC BEGIN #Routine body goes here... END;; 第二种是信任子程序的创建者,禁止创建、修改子程序时对SUPER权限的要求,设置log_bin_trust_routine

MySQL This function has none of DETERMINISTIC, NO SQL...错误1418 的原因分析及解决方法 (转)

旧城冷巷雨未停 提交于 2019-12-27 04:59:04
解决方法: 解决办法也有两种, 第一种是在创建子程序(存储过程、函数、触发器)时,声明为DETERMINISTIC或NO SQL与READS SQL DATA中的一个, 例如: CREATE DEFINER = CURRENT_USER PROCEDURE `NewProc`() DETERMINISTIC BEGIN #Routine body goes here... END;; 第二种是信任子程序的创建者,禁止创建、修改子程序时对SUPER权限的要求,设置log_bin_trust_routine_creators全局系统变量为1。 设置方法有三种: 1.在客户端上执行SET GLOBAL log_bin_trust_function_creators = 1; 2.MySQL启动时,加上--log-bin-trust-function-creators选贤,参数设置为1 3.在MySQL配置文件my.ini或my.cnf中的[mysqld]段上加log-bin-trust-function-creators=1 来源: https://www.cnblogs.com/King-boy/p/11058818.html

MySQL This function has none of DETERMINISTIC, NO SQL...错误1418 的原因分析及解决方法 (转)

我与影子孤独终老i 提交于 2019-12-27 04:58:15
解决方法: 解决办法也有两种, 第一种是在创建子程序(存储过程、函数、触发器)时,声明为DETERMINISTIC或NO SQL与READS SQL DATA中的一个, 例如: CREATE DEFINER = CURRENT_USER PROCEDURE `NewProc`() DETERMINISTIC BEGIN #Routine body goes here... END;; 第二种是信任子程序的创建者,禁止创建、修改子程序时对SUPER权限的要求,设置log_bin_trust_routine_creators全局系统变量为1。 设置方法有三种: 1.在客户端上执行SET GLOBAL log_bin_trust_function_creators = 1; 2.MySQL启动时,加上--log-bin-trust-function-creators选贤,参数设置为1 3. 在MySQL配置文件my.ini或my.cnf中的[mysqld]段上加log-bin-trust-function-creators=1 来源: https://www.cnblogs.com/xihong2014/p/5566383.html

MySQL函数使用

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-27 04:56:54
1、mysql开启函数功能 MySQL函数不能创建的解决方法 在使用 MySQL数据库时,有时会遇到mysql 函数不能创建的情况。 出错信息大致类似: ERROR 1418 (HY000): 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) ERROR 1418 (HY000): 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) MySQL函数不能创建,是没有开启函数功能,下面操作开启函数功能: mysql> show variables like '%func%'; +-----------------

MySQL 错误1418

帅比萌擦擦* 提交于 2019-12-27 04:55:51
创建function的时候报如下错误: Error Code : 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) (0 ms taken) 解决方法如下: 1. mysql> set global log_bin_trust_function_creators = 1; 2. 系统启动时 --log-bin-trust-function-creators=1 3. 配置文件my.conf中 [mysqld] 标记后加一行内容为 log-bin-trust-function-creators=1   参数og_bin_trust_function_creators的使用说明 开启二进制日志后,log_bin_trust_function_creators参数才会生效。 该参数控制是否信任允许用户创建的、可能会导致不安全事件被写入二进制日志的functions和triggers。 如果log_bin_trust_function

MYSQL this function has none of deterministic no sql ......错误

六眼飞鱼酱① 提交于 2019-12-27 04:53:13
This function has none of DETERMINISTIC, NO SQL解决办法 创建存储过程时 出错信息: ERROR 1418 (HY000): 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) 原因: 这是我们开启了bin-log, 我们就必须指定我们的函数是否是 1 DETERMINISTIC 不确定的 2 NO SQL 没有SQl语句,当然也不会修改数据 3 READS SQL DATA 只是读取数据,当然也不会修改数据 4 MODIFIES SQL DATA 要修改数据 5 CONTAINS SQL 包含了SQL语句 其中在function里面,只有 DETERMINISTIC, NO SQL 和 READS SQL DATA 被支持。如果我们开启了 bin-log, 我们就必须为我们的function指定一个参数。 解决方法: SQL code mysql> show variables like 'log

MySQL创建方法错误:This function has none of DETERMINISTIC, NO SQL

点点圈 提交于 2019-12-27 04:52:26
创建function时 出错信息: ERROR 1418 (HY000): 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) 原因: 这是我们开启了bin-log, 我们就必须指定我们的函数是否是 1 DETERMINISTIC 不确定的 2 NO SQL 没有SQl语句,当然也不会修改数据 3 READS SQL DATA 只是读取数据,当然也不会修改数据 4 MODIFIES SQL DATA 要修改数据 5 CONTAINS SQL 包含了SQL语句 其中在function里面,只有 DETERMINISTIC, NO SQL 和 READS SQL DATA 被支持。如果我们开启了 bin-log, 我们就必须为我们的function指定一个参数。 解决方法: SQL code mysql > show variables like ' %func% ' ; + -- -------------------------------+--

自定义mysql函数时报错,[Err] 1418 - This function has none of DETERMINISTIC......

点点圈 提交于 2019-12-27 04:51:50
  今天在我执行 自定义mysql函数 的SQL时发生了错误,SQL如下: /** 自定义mysql函数 getChildList */ delimiter // CREATE FUNCTION `pengwifi_wifi`.`getChildList`(rootId INT) RETURNS varchar(1000) BEGIN DECLARE sTemp VARCHAR(1000); DECLARE sTempChd VARCHAR(1000); SET sTemp = '$'; SET sTempChd =cast(rootId as CHAR); WHILE sTempChd is not null DO SET sTemp = concat(sTemp,',',sTempChd); SELECT group_concat(id) INTO sTempChd FROM hui_class where FIND_IN_SET(parent_id,sTempChd)>0; END WHILE; RETURN sTemp; END // 报错信息:[Err] 1418 - This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary