用户无法执行选择错误1142 [英] User cannot execute select error 1142

查看:110
本文介绍了用户无法执行选择错误1142的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的phpmyadmin或MySQL命令行不允许我执行以下查询:

My phpmyadmin or MySQL commandline will not let me execute the following query:

SELECT customer.First, customer.Last, login.Username, login.Password, customer.Addrln1,
    customer.Addrln2, customer.Postcode, customer.County, customer.Country, customer.Phone, customer.Email, 
    employee.EmpFirst, employee.EmpEmail, move.MoveID, move.CityOrig, move.CityDest, move.CountryOrig, 
    move.CountryDest, move.EnquiryDate, move.Surveydate, move.QuoteDate, move.DepEst, move.DepAct, move.ArrEst, move.ArrAct,
    move.ClearEst, move.ClearAct, move.DelEst, move.DelAct, move.Port, move.Method, move.Status
FROM customer
LEFT JOIN oim2.login ON customer.CustID = login.CustID
LEFT JOIN oim2.move ON customer.CustID = move.CustID
LEFT JOIN oim2.employee ON move.EmpID = employee.EmpID
WHERE customer.First =  'dave' and customer.Last='smith'

1142-表'login'的用户'oceanai3'@'localhost'的SELECT命令被拒绝

戴夫史密斯只是名字和姓氏的示例,用户可以执行以下查询: 选择*从登录 选择*从移动 选择*来自客户

1142 - SELECT command denied to user 'oceanai3'@'localhost' for table 'login'

Dave smith is just an example first and last name, the user can perform the following queries: SELECT * from login SELECT * FROM move SELECT * FROM customer

如果我从原始查询中删除要登录的引用,则会收到错误#1142-拒绝表'move'的用户'oceanai3'@'localhost'的SELECT命令.我已经粘贴了数据库的完整sql文件,可以在以下位置找到它: http://pastebin.com/H6aTS74m 我已经浏览了很多其他人的帖子以找到答案,但找不到任何可以帮助我的东西.

If I remove the references to login out of the original query I then get the error #1142 - SELECT command denied to user 'oceanai3'@'localhost' for table 'move'. I have pastebin'd the full sql file of the db and it can be found here at: http://pastebin.com/H6aTS74m I have trawled through a lot of other peoples posts to find an answer but I couldnt find anything that helped me.

谢谢

C

推荐答案

GRANT SELECT ON database.* TO user@'localhost' IDENTIFIED BY 'password';

用您的值替换占位符.

这篇关于用户无法执行选择错误1142的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆