1227 - Access denied you need at least one of the SUPER privilege s for this operation

0 votes

I am currently having an issue with MySQL! What's going wrong here? I am a cPanel user, and yes I have searched this and found no definitive answers. It appears this is more specific than other people with the same error codes issues. Please add a detailed response that I can follow along with! P.s I am using a shared hosting account.

DELIMITER $$-- 
-- Functions 
-- 
CREATE DEFINER = `root`@`localhost` FUNCTION `fnc_calcWalkedDistance` ( 
`steamid64` BIGINT UNSIGNED 
) RETURNS INT( 10 ) UNSIGNEDNO SQL BEGIN DECLARE finished INTEGER DEFAULT 0;

DECLARE distance INTEGER DEFAULT 0; 
DECLARE x1, x2, z1, z2 FLOAT; 

DECLARE curs CURSOR FOR SELECT x, z 
FROM log_positions 
WHERE `steamid` = steamid64 
ORDER BY `timestamp` DESC ; 

DECLARE CONTINUE HANDLER FOR NOT FOUND SET finished =1; 

OPEN curs; 

FETCH curs INTO x1, z1; 

SET x2 = x1; 

SET z2 = z1; 

calculate : LOOPFETCH curs INTO x1, z1; 

IF finished =1 THEN LEAVE calculate; 

END IF ; 

SET distance = distance + SQRT( POW( x2 - x1, 2 ) + POW( z2 - z1, 2 ) ) ; 

-- SET distance = distance + 1; 
SET x2 = x1; 

SET z2 = z1; 

END LOOP calculate; 

CLOSE curs; 

RETURN distance; 

END$$

Here is the error code:

MySQL said: Documentation 
#1227 - Access denied; you need (at least one of) the SUPER privilege(s) for this operation
Feb 17, 2022 in Web Development by Soham
• 9,710 points
11,950 views

1 answer to this question.

0 votes

To understand your doubt better, I assume this would mean you don't have privileges to create the trigger with root@localhost user..

Try removing definer from the trigger command:
 

CREATE DEFINER = root@localhost FUNCTION fnc_calcWalkedDistance


This should help solve your problem.

If you need to learn more, it's recommended you join the best Web Development courses online today.

Thanks!

answered Feb 17, 2022 by Aditya
• 7,680 points

Related Questions In Web Development

+1 vote
1 answer

How to access the Angularjs scope of a particular html element from our console?

Hello, You should follow the below steps:-- 1.Compile and ...READ MORE

answered Jan 21, 2020 in Web Development by Niroj
• 82,840 points

edited Jan 21, 2020 by Niroj 2,971 views
0 votes
0 answers

Getting the source of this click event in JQuery

I have multiple dynamically created buttons with ...READ MORE

Jul 21, 2022 in Web Development by gaurav
• 23,260 points
1,131 views
0 votes
0 answers

Getting the source of this click event in JQuery

I have multiple dynamically created buttons with ...READ MORE

Jul 22, 2022 in Web Development by gaurav
• 23,260 points
592 views
0 votes
0 answers

jQuery Remain at the top of an open collapsible table row when clicked

In an ideal world i didn't want ...READ MORE

Jul 28, 2022 in Web Development by gaurav
• 23,260 points
435 views
0 votes
1 answer
0 votes
1 answer

Want a command to be executed in Salt only if a directory is empty

You should consider using this inside your ...READ MORE

answered Jun 12, 2018 in DevOps Tools by Damon Salvatore
• 5,980 points
1,835 views
0 votes
1 answer

Creating A New MySQL User In Amazon RDS Environment

AWS RDS security groups documentation (a common ...READ MORE

answered Jul 18, 2018 in AWS by Priyaj
• 58,020 points
2,055 views
0 votes
1 answer

Using conditional to execute a command in salt

You can use unless inside your state ...READ MORE

answered Jul 23, 2018 in Other DevOps Questions by DareDev
• 6,890 points
2,076 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP