• Register
0 votes
267 views

Problem :

 I am currently facing an issue with MySQL!

I am the cPanel user, and I am looking for the solution on my issue. It seems this is more specific than other people with the same error codes issues.

Please find below my code for the reference:

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$$

Following is the error from the code:

MySQL said: Documentation

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

6 5 3
6,930 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

It clearly says that you do not have the required privileges to create the trigger with root@localhost user.

Please remove the definer from the trigger command as shown below:

CREATE DEFINER = root@localhost FUNCTION fnc_calcWalkedDistance

9 7 4
38,600 points

Related questions

0 votes
1 answer 79 views
0 votes
1 answer 23 views
0 votes
1 answer 71 views
0 votes
1 answer 41 views
41 views
Problem: I had installed MySQL on my linux server sometimes back now I forgot the password so I tried to change it using the ways I found online. What I did was as shown below: /etc/init.d/mysql stop mysqld_safe --skip-grant-tables & mysql --user root mysql SELECT * ... it still shows me below errors  "Access denied for user 'root'@'localhost' (using password: Yes)". How to fix above MYSql error?
asked Jul 14, 2020 Raphael Pacheco 4.9k points
1 vote
1 answer 486 views
486 views
Problem : I am naïve to mysql. Currently I am continuously facing below error. “Mysql access denied for user 'root'@'localhost' (using password yes)”. I have recently started using mySQL Workbench and after doing research on above error I found that my root's ... of no us. I want to get my root access back as soon as possible. Can somebody help me in getting my root access back?
asked Apr 7, 2020 morrisBson 3.2k points
0 votes
1 answer 80 views
80 views
Problem : I am new to MySql. The problem started when I was unable to login to Mysql using my Mysql console. It is repeatedly asking me the password and now I am unable to remember my password. Can I change my password ? And now when I am trying to open my PhpMyAdmin ... WAMP and after that deleted all my related files and then reinstalled it .But it did not fix my issue. How can I fix the issue ?
asked Feb 26, 2020 mphil 2.3k points
0 votes
1 answer 589 views
589 views
Problem : I have recently installed Ubuntu 16.04 and installed web server on it. Everything works well, but I am unable to access database. Even if I create new user and grant all privileges, I can't create database In PHP I am getting below error: SQLSTATE[HY000] [1698] ... ", $this->myname, $this->mypass, self::$mysettings);     } catch (PDOException $e) {         echo $e->getMessage();     } }
asked Jan 17, 2020 jwilliam 3.9k points
0 votes
2 answers 756 views
756 views
Problem : Whenever I want to open a mysql in my windows cmd by simply typing mysql. I am facing below error : “ERROR 1045 (28000): Access denied for user ODBC@localhost (using password: NO)” After that by looking at similar queries I somehow got the ... password=root ERROR 1045 (28000): Access denied for user 'admin'@'localhost' (using password:NO) Any pointers will be the great help.
asked Dec 18, 2019 alecxe 7.5k points
0 votes
1 answer 1.3K views
1.3K views
Problem : I am new to NodeJS and trying to connect to mySQL through the NodeJS file, however I am facing the below error : { Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'root'@'localhost' (using password: YES) at Handshake.Sequence._packetToError (/home/alecxe/Node ... bar" AS second_field', function(err, results, fields) { console.log(err); console.log(results); myconnection.end(); } );
asked Dec 6, 2019 alecxe 7.5k points
0 votes
1 answer 20 views
20 views
Problem: Being a new, need to get clear idea about the command to create directory? You need to create the directory /var/oracle/database/9i. Only the directory /var currently exists. From the root of the filesystem, which command will create the directory path? md -path /var/oracle/database/9i mkdir /var/oracle/database/9i mkd /var/oracle/database/9i mkdir -p /var/oracle/database/9i
asked Feb 18, 2020 maddi86 5.4k points