Results 1 to 5 of 5

Thread: MYSQL: Changing Column Name

Hybrid View

  1. #1
    Senior Member
    Join Date
    Apr 2002

    MYSQL: Changing Column Name


    How do you change a column's name in MYSQL?


  2. #2

    Re:MYSQL: Changing Column Name

    ALTER TABLE table_name CHANGE old_col_name create_definition

    create_definition is just like when you use CREATE .

    example: col1 INT or col2 VARCHAR(20)

  3. #3
    Senior Member
    Join Date
    Apr 2002

    Re:MYSQL: Changing Column Name

    Where do you specify the NEW_name

    if I have a db called 'testdb' and a table called 'testtable' with 'testcolumn' of def var(20)

    ALTER TABLE testtable CHANGE testcolumn var(20);

    I want to change the name to new_column. where?


  4. #4
    Join Date
    Apr 2002

    Re:MYSQL: Changing Column Name aoughta have all the info you need.

  5. #5
    alter table table_name change old_name new_name datatype(length)

    For more details:

Similar Threads

  1. seperate column
    By svar in forum Linux - Software, Applications & Programming
    Replies: 1
    Last Post: 07-19-2011, 06:26 PM
  2. Problem starting mysql conflicts with the RPM "mysql-5.0.27-1.fc6"
    By kamakshiganesh in forum Redhat / Fedora
    Replies: 2
    Last Post: 10-26-2007, 04:35 AM
  3. Changing Name Fields
    By stevan in forum Windows - General Topics
    Replies: 0
    Last Post: 06-22-2005, 07:28 PM
  4. Changing name of the computer:
    By shebang in forum Linux - General Topics
    Replies: 20
    Last Post: 06-02-2004, 05:53 PM
  5. Changing from XDM
    By mmiller9 in forum Linux - Software, Applications & Programming
    Replies: 3
    Last Post: 03-10-2003, 12:39 PM


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts