title: MySQL primary key renaming
body: <p>I have below tables </p>
  
  <pre><code>1. TABLE1 (Primary Key ID)
  2. TABLE2 (ID Foreign key reference from TABLE1)
  3. TABLE3 (ID Foreign key reference from TABLE1)
  4. TABLE4 (ID Foreign key reference from TABLE1)
  5. TABLE5 (ID Foreign key reference from TABLE1)
  </code></pre>
  
  <p>Above all 5 tables has huge data. </p>
  
  <p>Now I am trying to Rename <code>ID</code> as <code>OLD_ID</code> in <code>TABLE1</code></p>
  
  <p>I want to rename ID column by setting <code>SET FOREIGN_KEY_CHECKS = 0;</code>
  But unable to rename and getting below error </p>
  
  <blockquote>
    <p>Error Code: 1846 ALGORITHM=COPY is not supported. Reason: Columns
    participating in a foreign key are renamed. Try ALGORITHM=INPLACE.</p>
  </blockquote>
  
  <p>I know If I drop Foreign key from all the child table then renaming easily we can do. But remvoing and adding foreign key in the child table taking lot of time due to the huge data.</p>
  
  <p>Please suggest what are the best way to rename primary key field??</p>
  
  <p>I am doing this activity in MySql.  </p>