mysql错误代码1142_mysqldump命令

mysql错误代码1142_mysqldump命令I’mhavingtroubleswithacertainqueryononeofmyservers.OnallotherplacesI’vetestedititworkscompletelyfinebutontheserveriwanttouseititisn’tworking.It’saboutthefollowing…

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE稳定放心使用

mysql错误代码1142_mysqldump命令

I’m having troubles with a certain query on one of my servers. On all other places I’ve tested it it works completely fine but on the server i want to use it it isn’t working.

It’s about the following 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

This is the error code I get from it:

SELECT command denied to user ‘marco’@’localhost’ for table ‘projecten’

The tables:

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 ;

projecten:

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 ;

The strange part is that every other query on both the ‘projecten’ table and the ‘facturen’ table works completely fine, also this query works fine on two other servers of mine.

解决方案

You need to grant SELECT permissions to the MySQL user who is connecting to MySQL

see answers of the link ;)

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/187222.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号