views:

278

answers:

5

Hi all,

After I uploaded my application created using cakephp, I found out that I had to rename the database. I renamed my database accordingly and changed the settings in the database.php file in the "config" folder. But my application is still not running. I am being shown this error message "Missing Database table" "Error: Database table tbl_topics for model Topic was not found."

I have double checked the existence of tbl_topics in the database (it is there in the database) but the application says "table not found" what might be the problem, please help me out...

+1  A: 

Make sure the host/user/pass that you've set-up in the config.php file have access to that database and table

You could also try running cake schema generate --dry which will spit back any problems with the connection that you might be having

Also have a look in your app/tmp/logs for some extra information on the problems you are experiencing

duckyflip
+1  A: 

Take the username and password you are using for cakephp and it's db connection and connect to the database from the command line. I'm presuming you are using a unix-type system and mysql?

mysql --user=user_name --password=your_password db_name

...and then try to run a simple select:

SELECT * FROM tbl_topics

If you get an error there, it will at least identify that it is a low level db problem and the likely solution is that you need to grant permissions to that username to select from that database. Your current access levels for that user is probably granting access to the db under the old name.

Neil Trodden
I am able to connect properly. But I think there is some setting that cake is not showing me as to where to change the database's name apart from database.php file.
Gaurav Sharma
A: 

One last thought would be to check your model cache. I don't know why that would impact you with respect to connecting, but it's worth taking a look in app/tmp/cache.

Rob Wilkerson
+1  A: 

You have probably uploaded your cache files as well. Make sure you delete all the files in /app/tmp/cache/*

Warning: Don't delete the folders, files only!

Also, make sure your tmp folder and all the subfolders are world-writable.

dr Hannibal Lecter
A: 

:-) finally got it.... :-D

I forgot to assign the user access to my application's database on main server. After assigning the permissions all went fine.

Anyways thank you all for your valuable answers... It helped me gain some additional knowledge about cakephp.

Gaurav Sharma