Error: select command denied to user ''@'' for table ''
前端 未结 14 1758
被撕碎了的回忆
被撕碎了的回忆 2020-11-27 16:30

In my website, I am using MySQL database. I am using a webservice where in I do all my database related manipulations.

Now In one of the methods of that webservice,

14条回答
  •  时光取名叫无心
    2020-11-27 16:57

    select command denied to user ''@'' for table ''

    This problem is a basically generated after join condition are wrong database name in your join query. So please check the your select query in join table name after database.

    Then solve it for example its correct ans ware

    string g = " SELECT `emptable`.`image` , `applyleave`.`id` , `applyleave`.`empid` , `applyleave`.`empname` , `applyleave`.`dateapply` , `applyleave`.`leavename` , `applyleave`.`fromdate` , `applyleave`.`todate` , `applyleave`.`resion` , `applyleave`.`contact` , `applyleave`.`leavestatus` , `applyleave`.`username` , `applyleave`.`noday` FROM `DataEMP_ems`.`applyleave` INNER JOIN `DataEMP_ems`.`emptable` ON ( `applyleave`.`empid` = `emptable`.`empid` ) WHERE ( `applyleave`.`leavestatus` = 'panding' ) ";
    

    The join table is imputable and applyleave on the same database but online database name is diffrent then given error on this problem.

提交回复
热议问题