Mysql:执行命令被拒绝给用户'' localhost'对于例行错误

时间:2011-06-22 03:27:00

标签: mysql mysql-error-1064 privileges grant

我在打开旧网站时遇到了一些问题。我的数据表显示:

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

之后,我尝试调试我的脚本并在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'

然后我尝试使用Google搜索execute command denied to user 'jeinqa'@'localhost' for routine 'TestMediaControl.monthavrage',有些网站说我必须做一些GRANT

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

但我得到了:

#1370 - execute command denied to user 'jeinqa'@'localhost' for routine 'TestMediaControl.monthavrage'
你可以告诉我怎样才能解决这个问题?

4 个答案:

答案 0 :(得分:31)

它有效..... 我尝试在root中授予此权限。

  1. root
  2. 登录
  3. GRANT EXECUTE ON PROCEDURE TestMediaControl.monthavrage TO 'jeinqa'@'localhost'
  4. flush privileges;

答案 1 :(得分:10)

派对很晚也尝试组合。

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

flush privileges;

同时尝试用功能替换PROCEDURE。

答案 2 :(得分:4)

我几个小时前在phpMyAdmin中遇到过这种情况,当我执行存储过程时,我认为会将其检测为语法错误。

我在字段名称和计算字段之间缺少逗号,这给了我相同的错误消息。

答案 3 :(得分:-1)

昨天我遇到了这个问题,我预计会出现语法错误,但显示了此消息。

我的错误:我写了“ SELECT m.id,m.MAX(id_number)作为id_number ...”,而不是“ SELECT m.id,MAX(m.id_number)作为id_number ...”。错误在于MAX。错误消息并没有太大帮助。