Tag Archives: mysql

MySql – Error while dropping a foreign key constraint

Came across this error while trying to drop a foreign key constraint in a MySql database.

mysql> alter table qrtz_triggers drop foreign key qrtz_triggers_job_name_fkey; 
ERROR 1025 (HY000): Error on rename of '.\motechquartz\qrtz_triggers' to '.\motechquartz\#sql2-444-8' (errno: 152)

To figure out the actual problem, execute the following line:

mysql> show create table qrtz_triggers;

Most probably, the error would be because of either a mismatch in the constraint name or a mismatch in the casing of the constraint name.

Advertisements

MySQL: TYPE=InnoDB vs ENGINE=InnoDB

I was setting up Quartz scheduler (http://www.quartz-scheduler.org/) on my machine. It requires setting up the schema based on the database being used, which in my case happened to be MySQL 5.5. The SQL scripts provided in the Quartz installer for MySQL were failing on my machine. After spending a lot of time, I figured out that the reason for the failure was that the scripts were using TYPE = InnoDB instead of ENGINE = InnoDB.

‘TYPE =’   command was deprecated since MySQL 4.1, however it was still available for backward compatibility. Its support was completely removed since MySQL 5.4; Quartz still needs to update its scripts though.

Hope this saves time for somebody else…

MySQL Installation: Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed.

I was trying to install MySQL database on my Windows 7 machine today. The installation was successful, however ‘MySQL’ windows service was not getting started.

When checked the Event Viewer, I noticed the following errors:

  • Plugin ‘InnoDB’ init function returned error.
  • Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed.
  • Unknown/unsupported storage engine: INNODB

After spending a lot of time trying to figure out the cause for this, finally got some useful information in C:\ProgramData\MySQL\MySQL Server 5.5\data\Sanchit.err file. Based on the information logged in this file, it seemed that the log files at C:\ProgramData\MySQL\MySQL Server 5.5\data\ location had got corrupted. Deleting the following files resolved the problem for me: ib_logfile0, ib_logfile1 and ibdata1.