This error may occur when you are trying to create a table and it fails. There are many reasons that may cause this issue. One of the reason is related to Foreign Key constraint that is not formed correctly (Error code 150).
CREATE TABLE `prog_lang` ( `lang_id` INT NOT NULL PRIMARY KEY AUTO_INCREMENT, `lang_name` VARCHAR(100) NOT NULL, `lang_desc` VARCHAR(255) NOT NULL, `active_stat` CHAR(1) ); CREATE TABLE `topic` ( `topic_id` INT NOT NULL PRIMARY KEY AUTO_INCREMENT, `topic_desc` TEXT NOT NULL, `lang_id` INT NOT NULL, CONSTRAINT `fk_prog_lang` FOREIGN KEY(`lang_id`) REFERENCES `prog_lang`(`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Code2care'smission is to share varied knowledge in technical and non-technical areas gathered during day-to-day learnings and development activities so that our visitors can leverage this portal to find solutions to their queries without re-inventing the wheel. Technical posts include Learnings, Tutorials, Video Tutorials, Code Snippets, Tips-n-tricks.