33

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

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'

然后我试着用谷歌搜索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

5 回答 5

45

它的工作原理......我尝试在root.

  1. 登录为root
  2. GRANT EXECUTE ON PROCEDURE TestMediaControl.monthavrage TO 'jeinqa'@'localhost'
  3. flush privileges;
于 2011-09-10T08:03:16.670 回答
14

很晚的聚会也试试组合的。

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

flush privileges;

还可以尝试将 PROCEDURE 替换为 FUNCTION。

于 2014-03-11T21:02:32.150 回答
8

几个小时前,我在 phpMyAdmin 中遇到了这个问题,当时我执行了一个我认为会被检测为语法错误的存储过程。

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

于 2016-11-23T07:33:44.377 回答
-1

我也遇到了问题 - 我的错误是引用常规计数 - 访问被拒绝。

问题是我有“count(case when ...)”并且count和(。删除空格之间不能有空格修复了错误。

于 2022-01-06T14:05:13.373 回答
-2

I encountered this yesterday, I expected a syntax error but this message was shown.

My mistake: I wrote "SELECT m.id, m.MAX(id_number) as id_number..." instead of "SELECT m.id, MAX(m.id_number) as id_number...".... the error is with the MAX. The error message wasn't too helpful.

于 2020-04-11T08:47:58.260 回答