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 ...

0


a source to share


5 answers


:-) 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.

0


a source


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.

+1


a source


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.

+1


a source


You may have downloaded the cache files as well. Make sure you delete all files in / app / tmp / cache / *

Warning . Do not delete only folders, files!

Also, make sure your tmp folder and all sub folders are world writable.

+1


a source


The last thought would be to check the model cache. I don't know why it would affect your connectivity, but it's worth taking a look at app/tmp/cache

.

0


a source







All Articles