About error 1005 (HY000) in MySQL: can’t create table ‘_______ ‘(errno: 150) fool’s plan

I had this problem when I was building my watch today
Baidu checked many answer (including CSDN)
many bosses from the Angle of the InnoDB to solve, what say what type of master-slave table
white
I really can’t understand later widely verification
to find the problem in MySQL and SQL server syntax differences
when define a foreign key, MySQL must be outside the parentheses indicate the key attributes, otherwise an error will be submitted to the above
Ex. :
Create table course(course_id varchar(8),title varchar(50),dept_name varchar(20),credits numeric(2,0) check(credits> 0),primary key(course_id),foreign key(dept_name) references department on delete cascade);
will error create table course(course_id varchar(8),title varchar(50),dept_name varchar(20),credits numeric(2,0) check(credits> 0),primary Key (course_ID), Foreign Key (DEPT_name) REFERENCES Department (DEPt_name) on delete cascade);
executes normally

Read More: