0

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.

Sandeep
  • 83
  • 1
  • 9
  • http://stackoverflow.com/questions/10956195/mysql-error-1142-select-command-denied-to-user –  Dec 03 '14 at 13:19
  • @Axel i have grant every possible permission to mysql user...same user is working fine in custom script in same folder. I dnt think its a permission issue. – Sandeep Dec 03 '14 at 13:33
  • If its not permission issue then why it says it is? You can't say its not if its say it is. You forgot something. Check your query. –  Dec 03 '14 at 13:45
  • @Axel same code is working fine in localhost...and i have also tried to run custom script from the same sever and user..query is executing and fetching all result. so if there's permission with this user then the custom script should not work. right? – Sandeep Dec 04 '14 at 05:52

1 Answers1

1

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

Sandeep
  • 83
  • 1
  • 9