1

Using MySql 5.5.20 on OSX 10.8.3

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.

When executing the line:

/*!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 */

I get the error:

Error Code: 1146. Table 'crm.CRM_PURCHASEORDER' doesn't exist`

But the table CRM_PURCHASEORDER does exist.. It even has around 2000 rows of data.

Due to IP issues I cannot post the original dump, and I haven't had any luck reproducing a minimal test case.

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.

Black
  • 5,023
  • 6
  • 63
  • 92
  • 1
    Possible duplicate of http://stackoverflow.com/questions/6342201/mysql-bug-1146-table-xxx-xxxxx-doesnt-exist – Aiias Apr 08 '13 at 00:23
  • I'm not on Windows, not using phpmyadmin, and not copying DB files (creating new from script). The solutions there didn't help me. – Black Apr 08 '13 at 00:49

2 Answers2

3

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!

Black
  • 5,023
  • 6
  • 63
  • 92
0

Our team had a near melt down with this problem. It ended up copy/pasting queries out of whats app was causing the issue. It worked correctly when we retyped the query in but sharing queries over a messenger app was causing undetermined behavior.

LrakWortep
  • 217
  • 1
  • 4
  • 15