简体   繁体   English

需要帮助,以MAMP调试CakePHP与MySQL的连接,错误:数据库中缺少表(出于某种原因)

[英]Need Help Debugging CakePHP Connection to MySQL with MAMP, error: missing table in database (for what seems like no reason)

I asked a question earlier: Missing database table in CakePHP, I've followed the conventions and tried everything 之前我问了一个问题: CakePHP中缺少数据库表,我遵循约定并尝试了所有方法

and have since then discovered my problem is not in my model or controller, but rather somewhere in my connection with MAMP or the MySQL server. 从那以后发现我的问题不在我的模型或控制器中,而是在与MAMP或MySQL服务器的连接中。 It is important to note that I do have 2 models/controllers working fine with the database. 重要的是要注意,我确实有2个模型/控制器可以很好地处理数据库。 It's just that now I have added another controller/model and when I try to connect, Cake gives the error: Missing Database Table 只是现在我添加了另一个控制器/模型,当我尝试连接时,Cake给出了错误:缺少数据库表

Error: Table votes for model Vote was not found in datasource default. 错误:在数据源默认值中找不到模型Vote的表票。

I have been debugging this for two days, and have reproduced it working on another machine, so I'm sure my model/controller is set up correctly. 我已经调试了两天,并且已将其复制到另一台机器上,所以我确定我的模型/控制器设置正确。

I have narrowed the problem down to a couple things: 1. There is something messed up in my Cake configurations that has it using an old schema (I have no idea how that would happen) 2. There is something going wrong with MAMP connecting to the new tables 我将问题缩小为两点:1. Cake的配置中有些混乱,使用了旧的架构(我不知道会发生什么)2. MAMP连接出现了问题新表

Does anyone have any suggestions for debugging or solving this issue? 有人对调试或解决此问题有任何建议吗? Thank you so much. 非常感谢。

Wells 韦尔斯

Check that all your tables have the same Engine. 检查所有表是否具有相同的引擎。 I had a problem once because I had some tables on MyISAM and the new ones (generated by MySQL Workbench) on InnoDB 我曾经有一个问题,因为我在MyISAM上有一些表,而在InnoDB上有新的表(由MySQL Workbench生成)

Hope it helps 希望能帮助到你

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM