Changing column name to new col name

I looked up the MySQL for altering a column name and came up with the following –

ALTER TABLE PartnoLinkCat_assoc CHANGE 110684 PartNo NOT NULL;

110684 = old col name
PartNo = new col name

However, phpMyAdmin gives me a 1064 error. I don’t know what I’m doing wrong.

Can you help?

Thanks,
Steve

Have you tried using the phpMyAdmin interface to change the column name, i.e. go to Structure view and use the Change (pencil) icon?

Just tried this on a random table and the phpMyAdmin generated SQL includes the ‘type’ too. The MySQL docs seem to confirm this:

You can rename a column using a CHANGE old_col_name new_col_name column_definition clause. To do so, specify the old and new column names and the definition that the column currently has. For example, to rename an INTEGER column from a to b, you can do this:

ALTER TABLE t1 CHANGE a b INTEGER;

I used the Structure view and it worked!

Thanks!
Steve