Jump to content
Larry Ullman's Book Forums

Recommended Posts

I am trying to change the name of a field in a table, but it is part of the primary index. I can't figure out what the format is for dropping the primary index, altering the table field, creating the index with new field name.

Link to comment
Share on other sites

You've given no specifics, so I can't give a specific answer, but here's how you drop a primary index:

 

https://dev.mysql.com/doc/refman/5.7/en/drop-index.html

 

Then you alter the column name:

 

http://stackoverflow.com/questions/4002340/how-to-rename-a-table-column-in-mysql

 

Then you add the primary index:

 

https://dev.mysql.com/doc/refman/5.7/en/alter-table.html

Link to comment
Share on other sites

 Share

×
×
  • Create New...