Sql prob
#1

Код:
Error
SQL query: Documentation


CREATE DEFINER=`root`@`localhost` PROCEDURE `login` (IN `username` VARCHAR(24), IN `password` VARCHAR(42), IN `ip` VARCHAR(45), OUT `returncode` VARCHAR(24))  BEGIN
    DECLARE user_id INT;
    DECLARE user_exist TINYINT;
    DECLARE user_ban TINYINT;
    DECLARE login_attempts INT;
    DECLARE error_code INT;

    SET user_id = -1;
    SET error_code = 0;

    SELECT
        COUNT(*)
    INTO user_exist
    FROM players
    WHERE name = username;

    IF user_exist = 0 THEN
        SET error_code = 10;
    END IF;

    IF error_code = 0 THEN
        SELECT
            COUNT(*)
        INTO login_attempts
        FROM pcp_login_attempt
        WHERE (la_name = username
        OR la_ip = ip)
        AND la_error = 40
        AND TIMESTAMPDIFF(MINUTE, la_time, NOW()) <= 10;

        IF login_attempts >= 3 THEN
            SET error_code = 20;
        END IF;
    END IF;

    IF error_code = 0 THEN
        SELECT
            COUNT(*)
        INTO use[...]
MySQL said: Documentation

#1227 - Access denied; you need (at least one of) the SUPER privilege(s) for this operation
hoiw to fix this? pls help me bro's / sis's.. Thank you in Advance
Reply
#2

The account you're using doesn't have permission to use the CREATE PROCEDURE statement. It's quite clear, really. You may try removing DEFINER=`root`@`localhost` or replacing it with DEFINER=CURRENT_USER. If that doesn't work and you're on a shared host (i.e. you bought slots) then you're pretty much screwed because it's not likely that you will get the privileges.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)