mysql>   show function status;
+------+------------------+----------+------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
| Db | Name | Type | Definer | Modified | Created | Security_type | Comment | character_set_client | collation_connection | Database Collation |
+------+------------------+----------+------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
| zjzc | loadTreeByParent | FUNCTION | zjzc_app@% | 2016-06-02 21:51:04 | 2016-06-02 21:51:04 | DEFINER | | utf8 | utf8_general_ci | utf8_general_ci |
+------+------------------+----------+------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
1 row in set (0.00 sec) 重新创建函数; delimiter $$
CREATE FUNCTION `loadTreeByParent`(begin_sn INT) RETURNS varchar(600) CHARSET utf8
BEGIN
DECLARE rest VARCHAR(600);
DECLARE temp VARCHAR(60);
SET rest='$';
SET temp=CAST(begin_sn AS CHAR);
WHILE temp IS NOT NULL DO
SET rest=CONCAT(rest,',',temp);
SELECT GROUP_CONCAT(sn) INTO temp FROM ClientManager WHERE FIND_IN_SET(parent,temp)>0;
END WHILE;
RETURN rest;
END$$ mysql> show function status;
+------+------------------+----------+---------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
| Db | Name | Type | Definer | Modified | Created | Security_type | Comment | character_set_client | collation_connection | Database Collation |
+------+------------------+----------+---------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
| zjzc | loadTreeByParent | FUNCTION | root@% | 2016-06-03 19:04:41 | 2016-06-03 19:04:41 | DEFINER | | utf8 | utf8_general_ci | utf8_general_ci |
+------+------------------+----------+---------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
1 row in set (0.00 sec) CREATE DEFINER=`root`@`%` FUNCTION `loadTreeByParent`(begin_sn INT) RETURNS varchar(600) CHARSET utf8
BEGIN
DECLARE rest VARCHAR(600);
DECLARE temp VARCHAR(60);
SET rest='$';
SET temp=CAST(begin_sn AS CHAR);
WHILE temp IS NOT NULL DO
SET rest=CONCAT(rest,',',temp);
SELECT GROUP_CONCAT(sn) INTO temp FROM ClientManager WHERE FIND_IN_SET(parent,temp)>0;
END WHILE;
RETURN rest;
END 19:08:02 CREATE DEFINER=`zjzc_app`@`%` FUNCTION `loadTreeByParent`(begin_sn INT) RETURNS varchar(600) CHARSET utf8 BEGIN
DECLARE rest VARCHAR(600); DECLARE temp VARCHAR(60); SET rest='$'; SET temp=CAST(begin_sn AS CHAR);
WHILE temp IS NOT NULL DO SET rest=CONCAT(rest,',',temp);
SELECT GROUP_CONCAT(sn) INTO temp FROM ClientManager WHERE FIND_IN_SET(parent,temp)>0; END WHILE;
RETURN rest; END Error Code: 1227. Access denied; you need (at least one of) the SUPER privilege(s) for this operation 0.016 sec 直接进入终端,root登陆执行; mysql> delimiter $$
mysql> CREATE DEFINER=`zjzc_app`@`%` FUNCTION `loadTreeByParent`(begin_sn INT) RETURNS varchar(600) CHARSET utf8
-> BEGIN
-> DECLARE rest VARCHAR(600);
-> DECLARE temp VARCHAR(60);
-> SET rest='$';
-> SET temp=CAST(begin_sn AS CHAR);
-> WHILE temp IS NOT NULL DO
-> SET rest=CONCAT(rest,',',temp);
-> SELECT GROUP_CONCAT(sn) INTO temp FROM ClientManager WHERE FIND_IN_SET(parent,temp)>0;
-> END WHILE;
-> RETURN rest;
-> END$$
Query OK, 0 rows affected (0.00 sec)

mysql 创建函数 error Code: 1227. Access denied;的更多相关文章

  1. MySql 创建函数 Error Code : 1418

    查看日志信息:show variables like 'log_%';显示'log_bin'.'log_bin_trust_function_creators'等状态 解决方法: 关闭binary l ...

  2. win10连接mysql提示:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

    win10中cmd连接mysql提示:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YE ...

  3. MySQL学习笔记——ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) Enter password: E ...

  4. 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_f

    mysql 创建函数的时候 报错 ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or READS SQL D ...

  5. mysql安装启动 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

    首次安装mysql 启动 mysql -uroot 以下错误: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using ...

  6. mysql登录遇到ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

    执行mysql  -uroot  -p,出现如下问题 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using pass ...

  7. [解决] Error Code: 1044. Access denied for user 'root'@'%' to database

    今天在测试集群用的mysql上,遇到个权限的问题: SQLException : SQL state: 42000 com.mysql.jdbc.exceptions.jdbc4.MySQLSynta ...

  8. Error Code: 1044. Access denied for user 'root'@'%' to database

    mysql> SELECT host,user,password,Grant_priv,Super_priv FROM mysql.user; +--------------+--------- ...

  9. Linux下mysql出错:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

    安装: 1.新开的云服务器,需要检测系统是否自带安装mysql # yum list installed | grep mysql 2.如果发现有系统自带mysql,果断这么干 # yum -y re ...

随机推荐

  1. stm32之watchdog

    在嵌入式系统中,由于MCU的工作常常受到来自外界电磁场的干扰,造成程序的跑飞,而陷入死循环,程序的正常运行被打断,由单片机控制的系统无法继续工作,会造成整个系统陷入停滞状态,发送不可预料的后果,所以出 ...

  2. pop,墨刀,快现、justinmind 、Axure

    原型设计软件 墨刀:https://modao.cc Justinmind: http://www.zhihu.com/question/26662368/answer/33586218 http:/ ...

  3. word2013 无endnote选项卡咋办

    word2013 无endnote选项卡咋办? 前提: 已经安装了endnotex7,office word2013 word->文件->选项->加载项->最下面的 管理 &q ...

  4. C语言,链表反转

    倒序思路:依次把后面的节点移往头部. struct Node{ struct Node* next; int data; }; typedef struct Node NODE; NODE* inve ...

  5. SQL -主键&外键

    在创建表的时候,添加主键 CREATE TABLE table_name (column_1 char(10) PRIMARY KEY, column_2 char(10) ) 如果已经创建了表,如何 ...

  6. RPC通信框架——RCF介绍(替换COM)

    阅读目录 RPC通信框架 为什么选择RCF 简单的性能测试 参考资料 总结 现有的软件中用了大量的COM接口,导致无法跨平台,当然由于与Windows结合的太紧密,还有很多无法跨平台的地方.那么为了实 ...

  7. CVPapers论文整理工具-开源

    一.工具介绍及运行实例 相信计算机视觉领域的同道中人都知道这个Computer Vision Resource网站, http://www.cvpapers.com/  网页部分截图如下: 可以看到有 ...

  8. Unix/Linux环境C编程新手教程(24) MySQL 5.7.4 for Red Hat Enterprise 7(RHEL7)的安装

    远观历史, MySQL的主要目的是为了可以在单处理器核心的商业服务器上执行.现在MySQL的一个变化用户可能不会注意到,那就是甲骨文已经開始又一次架构MySQL的代码,使它大量的模块化.如软件解析器, ...

  9. eclipse的SVN插件的配置

    http://www.cnblogs.com/kekec/archive/2010/08/09/1795581.html

  10. Notepad++中如何设置自动换行以及行宽

    view-->word wrap; setting->preference-->vertical edge settings; Notepad++中如何设置自动换行以及行宽 http ...