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 in Web Development by Soham
• 8,730 points
713 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 by Aditya
• 7,280 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,680 points

edited Jan 21, 2020 by Niroj 611 views
0 votes
0 answers

Anyone can help me out to understand the semantic of (document.getElementBYId("demo").innerHTML="Hello") ?

Hello guys, Can Someone helps me to find ...READ MORE

Jan 17, 2020 in Web Development by anonymous
• 37,510 points
357 views
+2 votes
1 answer

What are the different ways of using angularjs scope?

Hey!! basically there the three ways of using ...READ MORE

answered Jan 21, 2020 in Web Development by Niroj
• 82,680 points
202 views
+1 vote
1 answer

What are the different types of pop-up boxes available in JavaScript?

There are  basically three types of pop-up ...READ MORE

answered Jan 22, 2020 in Web Development by Niroj
• 82,680 points
650 views
0 votes
1 answer

What does cors means in Angularjs and what the use of it?

CORS is Cross Origin Resource Sharing which means you ...READ MORE

answered Jan 29, 2020 in Web Development by kartik
• 37,510 points
2,695 views
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
590 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,060 points
1,345 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
680 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP