错误代码:1146.但表确实存在 [英] Error Code: 1146. but Table does exist
问题描述
在 OSX 10.8.3 上使用 MySql 5.5.20
Using MySql 5.5.20 on OSX 10.8.3
我正在使用相同的主要版本 (5.5) 从另一台服务器恢复 mysql 转储有一堆表 CREATE 和 INSERT 语句,然后在最后定义了一些触发器.
I'm restoring a mysql dump from another server using the same major version (5.5) There are a bunch of table CREATE and INSERT statements, then towards the end there are some Triggers defined.
执行该行时:
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/
/*!50003 `TRIGGER delete_po_items AFTER DELETE ON CRM_PURCHASEORDER
FOR EACH ROW BEGIN DELETE FROM CRM_PO_ITEM
where CRM_PO_ITEM.PURCHASEORDER_ID = OLD.PURCHASEORDER_ID; END */
我收到错误:
Error Code: 1146. Table 'crm.CRM_PURCHASEORDER' doesn't exist`
但是表 CRM_PURCHASEORDER 确实 存在..它甚至有大约 2000 行数据.
But the table CRM_PURCHASEORDER does exist.. It even has around 2000 rows of data.
由于 IP 问题,我无法发布原始转储,而且我没有任何运气重现最小的测试用例.
Due to IP issues I cannot post the original dump, and I haven't had any luck reproducing a minimal test case.
任何提示可能导致这种情况的原因?我在 SO 上看到了其他一些类似的帖子,但没有找到适合我的解决方案.
Any hint what could cause this? I saw some other similar postings on SO, but haven't had luck finding a solution that works for me.
推荐答案
这个问题是关于 MySql 中表名和列名区分大小写的问题,尤其是可以设置的变量 lower_case_table_names
对于具有三个可能值的 MySql 服务器实例!
This issue is all about case-sensitivity of table and column names in MySql, - most notably the variable lower_case_table_names
which can be set for a MySql server instance with three possible values!
这篇关于错误代码:1146.但表确实存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!