Home:ALL Converter>Why does Mysql rename my foreign key?

Why does Mysql rename my foreign key?

Ask Time:2014-08-26T20:29:04         Author:Seani Wild

Json Formatter

Why does Mysql/InnoDB seem to rename some of the foreign keys I create?

e.g.

mysql> alter table JOB_LISTENER add foreign key FK_JOBS (job_id) REFERENCES job(id);
mysql>
mysql> show create table JOB_LISTENER;
snip> ....
mysql> CONSTRAINT `JOB_LISTENER_ibfk_4` FOREIGN KEY (job_id) REFERENCES job (id)
snip> ....

it renames the foreign key i created named FK_JOBS to JOB_LISTENER_ibfk_4 - any ideas why it does that?

Many thanks,

Sean

Author:Seani Wild,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/25505861/why-does-mysql-rename-my-foreign-key
yy