douwei9973 2014-12-03 12:56
浏览 43
已采纳

Zend应用程序迁移问题与运行select查询权限被拒绝执行select语句

Well, I am migrating a zend application from localhost to hosting. I have copied application form another server which was running successfully, but some issue with old server so i need to move...i have configured zend application on my local system and its working perfectly. the PHP version is 5.5.15. When i move the application to new server (PHP version 5.5.18). I am getting error:-

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1142 SELECT command denied to user 'user'@'localhost' for table 'page'' in /home/spreadca/public_html/library/Zend/Db/Statement/Pdo.php:228 Stack trace: #0 /home/spreadca/public_html/library/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array) #1 /home/spreadca/public_html/library/Zend/Db/Statement.php(303): Zend_Db_Statement_Pdo->_execute(Array) #2 /home/spreadca/public_html/library/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array) #3 /home/spreadca/public_html/library/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('DESCRIBE sprea...', Array) #4 /home/spreadca/public_html/library/Zend/Db/Adapter/Pdo/Mysql.php(171): Zend_Db_Adapter_Pdo_Abstract->query('DESCRIBEsprea...') #5 /home/spreadca/public_html/library/Zend/Db/Table/Abstract.php(836): Zend_Db_Adapter_Pdo_Mysql->describeTable('page', 'spreadcashback_...')...

I have given mysql user full permission. i have also tried with custom mysql php script to run select query from this user. and its working fine. Changed many PHP version into 5.3 to 5.5 to check. Same application is working fine with my localhost in 5.5.15 PHP version.

When i have copied application from old server there was no Zend folder into library. so i have installed Zend 1.12.9 and copy there's Zend folder into application. It is working like charm in localhost. I dont know why it is happening i have so many time in stackoverflow to resolve my issue. As i am newbie in Zend.

Thanks in Advance guys. Looking for your answers very desperately.

Edit:

The application is working fine in my localhost (PHP version 5.5.15, OS:- Win7) And my webhosting is linux. Is there any issue with OS in Zend.

  • 写回答

1条回答 默认 最新

  • doulu6160 2014-12-04 09:50
    关注

    After being tired with this issue. I have fixed issue by myself. I am newbie in zend. and thanks to @Axel. You were right the issue was with permission. I was also doing same but as i am newbie to zend so preveious developer has mention db name in Core/Db/Table/Abstract.php $_schema="DBname"; and in new server db name was changed thats why connetion was establishing but in selecting table the db name was changing because its mention file. Now everything looks Great. Thanks

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波
  • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗
  • ¥15 钢筋实图交点识别,机器视觉代码
  • ¥15 如何在Linux系统中,但是在window系统上idea里面可以正常运行?(相关搜索:jar包)
  • ¥50 400g qsfp 光模块iphy方案
  • ¥15 两块ADC0804用proteus仿真时,出现异常
  • ¥15 关于风控系统,如何去选择