且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

CakePHP数据库表,缺少数据源默认

更新时间:2023-02-02 21:49:03

在phpMyAdmin或MySql工作台?该表是否存在于数据库中?

Have you checked your database, e.g. in phpMyAdmin or MySql workbench? Does the table exist in the database?

错误消息表明无法使用默认连接访问表。这可能是表真的缺失,或者您用于连接到数据库的用户没有该表的正确权限。

The error message indicates that the table could not be accessed using the default connection. It's possible that the table is really missing, or that the user you're using to connect to the database does not have the right permissions for that table.

如果您迁移数据库从另一个服务器,您在导入时是否收到错误消息?

If you migrated the database from another server, did you get error messages while importing? If you did not create a dump enclosed in a transaction, it's possible that the database dump was only partially imported.

[update] 此建议可能会导致数据库转储被部分导入。解决问题;

[update] this suggestion solved the problem;

app / tmp / cache / persistent / app / tmp / cache / models ,然后启用调试。您的SQL日志/调试应显示CakePHP用来检测表是否存在于数据库中的查询。此外,你可以检查如果Cake写入tmp文件没有问题

Remove all files from app/tmp/cache/persistent and /app/tmp/cache/models then enable debugging. Your SQL log/debug should show the queries that CakePhp is using to detect if the tables exist in the database. Also you'll be able to check if Cake writes to the tmp files without problems