In case of a foreign key error when creating or altering a table, MySQL doesn't show the full message.
You can read the full message by executing the following query and inspecting the Status column.
show engine innodb status;
------------------------ LATEST FOREIGN KEY ERROR ------------------------ 2018-02-13 11:12:26 0x70000b776000 Error in foreign key constraint of table table/#sql-7fa_247a: foreign key (`my_foreign_key`) references `table` (`id`) on delete cascade: Cannot resolve table name close to: (`id`) on delete cascade
Things I wish I knew when I started programming
This is my newest book aimed at programmers of any skill level. This book isn't about patterns, principles, or best practices; there's actually barely any code in it. It's about the many things I've learned along the way being a professional programmer, and about the many, many mistakes I made along that way as well. It's what I wish someone would have told me years ago, and I hope it might inspire you.
Comments
Loading…
No comments yet, be the first!
0 Comments
Log in to join the conversation.No comments yet. Be the first to share your thoughts.