Mysql: execute command denied to user ''@'localhost' for routine error

102,284

Solution 1

It works..... I try to grant this priviledge in root.

  1. log in as root
  2. GRANT EXECUTE ON PROCEDURE TestMediaControl.monthavrage TO 'jeinqa'@'localhost'
  3. flush privileges;

Solution 2

Very late to the party also try a combination of.

GRANT EXECUTE ON PROCEDURE TestMediaControl.monthavrage TO 'jeinqa'@'%';

AND

flush privileges;

Also try replacing PROCEDURE with FUNCTION.

Solution 3

I have encountered this in phpMyAdmin, a few hours ago, when executing a stored procedure with what I thought would be detected as a syntax error.

I was missing a comma between a field name, and a calculated field, and this gave me the same error message.

Share:
102,284
nunu
Author by

nunu

I'm a beginner at web programming. And still need guidance for making it. I work with HTML,JQUERY,MYSQL,AJAX,PHP.

Updated on January 07, 2022

Comments

  • nunu
    nunu over 2 years

    i got some problem during open my old website. My dataTable show:

    DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.
    

    After that, I tried to debug my script and found error in mysql:

    Error occuered during query execution: 
    (<small>SELECT SQL_CALC_FOUND_ROWS ID,name,remark,avrusepmonth 
            , CONCAT('&lt;input type=''checkbox''id=''cb' , ID ,''' name=''check[]''                
            value=''',ID,''' &gt;','&lt;label class=''lbcb'' for=''cb', 
            ID,'''&gt;&lt;=update=&lt;/label&gt;') as checkb 
            ,monthavrage(ID,12) as latestavr , moq, leadtime 
            FROM test_media  WHERE nowuse=1 and monthavrage(ID,12)  &gt; 0  ORDER BY  name
            desc, ID
            LIMIT 0, 10</small>):
     execute command denied to user 'jeinqa'@'localhost' for routine 'TestMediaControl.monthavrage'
    

    Then I tried to googling for execute command denied to user 'jeinqa'@'localhost' for routine 'TestMediaControl.monthavrage' and some sites said that I must do some GRANT:

    GRANT EXECUTE ON PROCEDURE TestMediaControl.monthavrage TO 'jeinqa'@'localhost'
    

    but I got:

    #1370 - execute command denied to user 'jeinqa'@'localhost' for routine 'TestMediaControl.monthavrage'
    

    could you tell me how should I do for solving this?