执行命令被拒绝给用户“'@”localhost'对于常规错误

发布于 2024-11-16 16:52:07 字数 1318 浏览 11 评论 0原文

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

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 returned to user 'jeinqa'@'localhost' forroutine 'TestMediaControl.monthavrage' 有些网站说我必须做一些GRANT

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

但我得到:

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

你能告诉我我应该怎么做才能解决这个问题?

I have 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('<input type=''checkbox''id=''cb' , ID ,''' name=''check[]''                
        value=''',ID,''' >','<label class=''lbcb'' for=''cb', 
        ID,'''><=update=</label>') as checkb 
        ,monthavrage(ID,12) as latestavr , moq, leadtime 
        FROM test_media  WHERE nowuse=1 and monthavrage(ID,12)  > 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

堇色安年 2024-11-23 16:52:07

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

  1. 以 root 身份登录
  2. 将程序 TestMediaControl.monthavrage 上的执行授予 'jeinqa'@'localhost'
  3. flush 权限;

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;
终止放荡 2024-11-23 16:52:07

很晚参加聚会也尝试一下组合。

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

并且

flush privileges;

还尝试将 PROCEDURE 替换为 FUNCTION。

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.

影子是时光的心 2024-11-23 16:52:07

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

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

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.

倾其所爱 2024-11-23 16:52:07

当我尝试在查询中使用 MIN 函数时,我遇到了同样的错误。

Error Code: 1370. execute command denied to user 'a.user'@'%' for routine 'mysqlserver.MIN'

MySQL 不喜欢在 MIN 和开头 ( 之前看到空格。

在阅读上面的内容并尝试使用 MIN(..) 而不是 MIN (..) 后,我的查询成功了。

想想看。

I got the same error when trying to use the MIN function in my query.

Error Code: 1370. execute command denied to user 'a.user'@'%' for routine 'mysqlserver.MIN'

MySQL didn't like seeing a space before MIN and the opening (.

After reading the above and trying MIN(..) instead of MIN (..) my query worked.

Go figure.

掩耳倾听 2024-11-23 16:52:07

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

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

I had the problem too - my error was quoting was with routine count - access denied.

The problem was I had "count (case when...)" and there cannot be a space between count and (. removing spaces fixed the error.

零度℉ 2024-11-23 16:52:07

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

我的错误:我写了“SELECT m.id, m.MAX(id_number) as id_number...”而不是“SELECT m.id, MAX(m.id_number) as id_number...”...错误是与最大。错误消息没有太大帮助。

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.

晨敛清荷 2024-11-23 16:52:07

参加聚会已经很晚了。我也犯了一个语法错误并得到了同样的错误。我在 MAX 函数 - MAX (ABC) 之间使用了一个空格。删除空格 MAX(ABC) 后就可以工作了。

Very very late to the party. I also committed a syntax mistake and got the same error. I used a space between my MAX function - MAX (ABC). Got it working after removing the space MAX(ABC).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文