How to change column name in MySQL

15 pts.
Tags:
MySQL
I need to change column name in MySQL. What should be the command for writing it?


Software/Hardware used:
MySql Server 5.5
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

use this : –

ALTER TABLE “table_name” CHANGE “old_column_name” “new_column_name” DATATYPE;

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Subhendu Sen
    Try this:
    alter table [tablename] change [oldcolname] [newcolname] [datatype]
    then press enter
    It is necessary to specify the datatype(like int/char, whatever it is) of the renamed column
     
    137,090 pointsBadges:
    report
  • sachnikh
    thank you very much..
    15 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: