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. swift 关于 toolbar 学习笔记

    import UIKit class ViewController: UIViewController { @IBOutlet weak var toolBar: UIToolbar! @IBOutl ...

  2. Case of the Zeros and Ones

    Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Description Andrew ...

  3. opencv鼠标绘制直线 C++版

    因为需要在图片上标记直线,所以从网上找了相应的参考资料.但大多都是c风格的,于是自己就写了一个c++风格的. opencv2.4.11,win8.1,vs2013 #include <cv.h& ...

  4. 【转】CentOS6.5 增加一个SFTP上传的用户

    原文链接地址:http://www.msits.com/archives/4477.html #创建sftp组groupadd sftp#创建一个用户zjhpuseradd -g sftp -s /b ...

  5. android页面切换效果

    两种方式: 在activity的自定义主题中定义切换方式: overridePendingTransition()方法 自定义主题: 在项目的res/values/styles.xml中添加样式 &l ...

  6. mysql 结合keepalived测试

    vip:192.168.32.66 192.168.32.6 主库: mysql> show variables like '%read_only%'; +------------------+ ...

  7. 有关oppo蝴蝶解锁的三D技术

    oppo手机的界面设计也是很漂亮的.在很多界面中使用了3D技术塑造出了大量华丽的效果.在蝴蝶解锁中使用了两个对称的三D变幻,宛如蝴蝶翅膀上美丽的花纹.在受到用户点击后,随风缓慢上下扇动,充满浪漫的动感 ...

  8. 在vc中使用xtremetoolkit界面库-----安装及环境配置

    近期想用一下xtremetoolkitPro界面库.网上的使用教程资源也不多,当中着实遇到了很多的困难,毕竟是首次使用. 首先当然是配置发开环境了: 我使用的是vc6.0+xtremetoolkitP ...

  9. ADO.NET 2SqlDataAdapter、DataSet 的基本用法

    数据集完全独立于数据源,可以与数据源链接或者完全断开,其基本作用是为存储在内存缓存中的的数据提供关系视图 如果只是想读取和显示数据,则值需要使用数据读取器,尤其是处理大量数据的时候 如果需要处理数据, ...

  10. VPN指定某个程序,其实是改路由表(赛风支持VPN和SSH和SSH+模式)

    其实就是使用IE代理的意思,方法有很多.最简单的就是读取注册表中的代理信息.具体找;\Software\Microsoft\Windows\CurrentVersion\Internet Settin ...