tags:

views:

484

answers:

2

I have a CakePHP application that is running fine locally. I uploaded it to a production server and the first page that uses a database connection gives the "Missing Database Table" error. When I look at the controller dump, it's complaining about the first table.

I've tried a variety of things to fix this problem, with no luck:

  • I've confirmed that at the command line I can login with the given MySQL credentials in database.php
  • I've confirmed this table exists
  • I've tried using the MySQL root credentials (temporarily) to see if the problem lies with permissions of the user. The same error appeared.
  • My debug level is currently set to 3
  • I've deleted the entire contents of /app/tmp/cache
  • I've set 777 permissions on /app/tmp*
  • I've confirmed that I can run DESCRIBE commands at the commant line MySQL when logged in with the MySQL credentials used by by the application
  • I've verified that the CakePHP log file only contains the error I'm setting in the browser window.
  • I've tried all the suggestions I could find in similar postings on SO
  • I've Googled around and didn't find any other ideas

I think I've eliminating the obvious problems and my research isn't turning anything up. I feel like I'm missing something obvious. Any ideas?

A: 

Did you try checking to see if the production database is being picked up correctly ? Try an echo on the production server, and see what database it selects. Also, make sure the tables don`t have different case names, than on the production server. MySQL can be configured to make a difference between 'Table' and 'table'. You may have some lines of code that are selecting different databases based on the TLD, like I see being done many times.

Adrian A.
Great idea, but no help. The table name Cake is trying to get is "accounts", it's "accounts" in the database and I set lower_case_table_names to 1, all without luck.
Justin
Also, I don't understand what you mean by echo in the context of MySQL. Can you explain?
Justin
I was saying that you should echo the actual parameters in the view in order to see what the actual selected database is. Primitive but usefull :)
Adrian A.
A: 

Epic fail on my part. There was a space at the end of my database name in the database.php. Interesting that this didn't return a connection issue (perhaps they trim the name on testing the connection?).

Justin
That's not a "Epic fail"... It's more like a EPHIC FAIL!
TiuTalk
LOL. Or maybe "Epic fail "
Justin