title: Replacing constraints on mysql db, one always fails
body: <p>MySQL: 5.5.27</p>
  
  <p>phpMyAdmin: one of the most recent versions</p>
  
  <p>I have a db that contains, among other tables, these:</p>
  
  <ul>
  <li>member</li>
  <li>language</li>
  <li>member_language</li>
  </ul>
  
  <p>As I created it in a hurry and had to populate it for testing purposes, I discovered belatedly that not all the constraints were as they should be. For example, <strong>member_id</strong> in the <strong>member_language</strong> table must obviously map to <strong>mem_id</strong> in the <strong>member</strong> table, and <strong>language_id</strong> in the <strong>member_language</strong> table must map to <strong>lang_id</strong> in the <strong>language</strong> table. So I recreated all 3 tables, then re-imported all the data into the copied tables: first member, then language, and finally member_language.</p>
  
  <p>Then I tried to enforce the constraints on member_language, but it fails to create the fk constraint for <strong>member.mem_id</strong> which would link it to <strong>member_language.member_id</strong>. Each time it throws the</p>
  
  <pre><code>#1452 error - Cannot add or update a child row: a foreign key constraint fails (`dbname`.`#sql-122f_bec4cef`, CONSTRAINT `#sql-122f_bec4cef_ibfk_2` FOREIGN KEY (`member_id`) REFERENCES `member` (`mem_id`))
  </code></pre>
  
  <p>Can someone point me in the right direction here?
  Tks
  SP</p>