title: Setting up foreign key in Mysql Workbench
body: <p>I am trying to set up a foreign key in Mysql workbench. I used the same name for the foreign key as the primary key of the table I am trying to set a relationship with. I already have one relation set up this way in another table, but When I try and apply the alterations to this table, the script gives me an error:    </p>
  
  <blockquote>
    <p><strong>Error 1005</strong>: Can't create table 'X.#sql-718_a' (errno: 121)</p>
  </blockquote>
  
  <h3>SQL Statement:</h3>
  
  <pre><code>ALTER TABLE `X`.`X_use`    
  ADD CONSTRAINT `XyzID`   
  FOREIGN KEY (`XyzID` )   REFERENCES `X`.`Xyz` (`XyzID` )   
  ON DELETE NO ACTION   O
  N UPDATE NO ACTION , 
  ADD INDEX `XyzID` (`XyzID` ASC)  , 
  </code></pre>
  
  <p>However, if I change the foreign key name to "AbcID" I have no problem setting up the foreign key relation. Why is that and why can't I have the primary key name from one table be the same for the foreign key for this table? I have set up relations like that previously but for this table I cannot.    </p>