mysql查询表时报1142_MySQL错误:#1142-拒绝用户的SELECT命令

我在其中一台服务器上进行某些查询时遇到麻烦。在我测试过的所有其他地方,它都可以正常工作,但是在我要使用的服务器上,它无法正常工作。

关于以下SQL:

SELECT facturen.id AS fid,

projecten.id AS pid,

titel,

facturen.totaal_bedrag AS totaal,

betaald,

datum

FROM facturen,

projecten

WHERE facturen.project_id = projecten.id

AND projecten.eigenaar = '1'

ORDER BY datum DESC

这是我从中得到的错误代码:

SELECT command denied to user 'marco'@'localhost' for table 'projecten'

表格:facturen:

CREATE TABLE IF NOT EXISTS `facturen` (

`id` int(11) NOT NULL auto_increment,

`project_id` int(11) NOT NULL,

`datum` int(11) NOT NULL,

`lever_datum` int(11) NOT NULL,

`totaal_bedrag` decimal(9,2) NOT NULL,

`btw` decimal(9,2) NOT NULL,

`bedrijf` varchar(40) NOT NULL,

`contactpersoon` varchar(60) NOT NULL,

`adres` varchar(60) NOT NULL,

`postcode` varchar(7) NOT NULL,

`plaats` varchar(30) NOT NULL,

`betaald` int(11) NOT NULL,

PRIMARY KEY (`id`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=201200006 ;

投影:

CREATE TABLE IF NOT EXISTS `projecten` (

`id` int(11) NOT NULL auto_increment,

`titel` varchar(80) NOT NULL,

`eigenaar` int(11) NOT NULL,

`creatie_datum` int(11) NOT NULL,

`eind_datum` int(11) NOT NULL,

`totaal_bedrag` decimal(9,2) NOT NULL,

`btw` decimal(9,2) NOT NULL,

PRIMARY KEY (`id`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=201200004 ;

奇怪的是,“ projecten”表和“ facturen”表上的所有其他查询都可以正常工作,而该查询在我的另外两个服务器上也可以正常工作。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值