Why am I getting errors after renaming my database to CakePHP?
After I loaded my application built using cakephp I found out that I had to rename the database. I renamed my database and changed the settings in the database.php file in the "config" folder. But my application still doesn't work. I am shown this error message "Missing database table" "Error: tbl_topics database table for model Topic not found."
I double checked the existence of tbl_topics in the database (it is in the database), but the app says "table not found" which might be the problem, please help me ...
a source to share
:-) finally got it ....: - D
I forgot to assign a user access to my application database on the main server. After assigning permissions, everything went fine.
Anyway, thanks to all of you for your valuable responses ... This helped me gain some additional knowledge about cakephp.
a source to share
Make sure the host/user/pass
one you configured in the config.php file has access to this database and table
You can also try running cake schema generate --dry
, which will throw away any connection problems you may have
Also take a look at app/tmp/logs
for more information on the problems you are experiencing.
a source to share
Take the username and password you are using for cakephp and that db connection and connect to the database from the command line. I am assuming you are using unix type system and mysql?
mysql --user=user_name --password=your_password db_name
... and then try a simple selection:
SELECT * FROM tbl_topics
If you get an error there, it will at least determine that it is a low level db issue, and the likely solution is that you need to grant permissions to that username to select from this database. Your current access levels for this user probably grant db access under the old name.
a source to share