loie Posted April 10, 2015 Share Posted April 10, 2015 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 More sharing options...
Larry Posted April 11, 2015 Share Posted April 11, 2015 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 More sharing options...
Recommended Posts