zoukankan      html  css  js  c++  java
  • Mysql创建nextval函数

    1,

    mysql 创建函数出错信息如下:

    Error Code: 1227. Access denied; you need (at least one of) the SUPER privilege(s) for this operation

    首先检查创建函数的功能是否开启,检查是否开启创建功能的SQL如下:

    -- 查看是否开启创建函数的功能
    show variables like '%func%';
    -- 开启创建函数的功能
    set global log_bin_trust_function_creators = 1;

    执行完SQL之后发现已经开启了,随检查自己的SQL是否写错

    2,

    DROP FUNCTION IF EXISTS `nextval`;
    delimiter ;;
    CREATE DEFINER=`root`@`127.0.0.1` FUNCTION `nextval`(n varchar(50)) RETURNS int(11)
    begin
    declare _cur int;
    set _cur=(select current_value from tb_sequence where name= n);
    update tb_sequence
    set current_value = _cur + _increment
    where name=n ;
    return _cur;
    end
    ;;
    delimiter ;
     
    3,图片创建
  • 相关阅读:
    Encoding
    F Takio与Blue的人生赢家之战
    D FFF团的怒火
    C Golden gun的巧克力
    B 倒不了的塔
    A jubeat
    17230 计算轴承半径
    10686 DeathGod不知道的事情
    10688 XYM-AC之路
    10692 XYM-入门之道
  • 原文地址:https://www.cnblogs.com/bluestear/p/9995431.html
Copyright © 2011-2022 走看看