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 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?