2010-11-19 69 views
6

搜索后,我无法弄清楚我需要做什么在ALTER TABLE genres将col id更改为genre_id有什么想法?在MySQL中更改列名称

+0

拉胡尔有答案,以供参考见http://dev.mysql.com/doc/refman/5.1/en/alter-table.html – 2010-11-19 11:54:56

+0

我通过看,但继续得到语法错误。 – Johnny 2010-11-19 11:55:40

回答

11
alter table genres change id genre_id int(10) auto_increment; 
+0

@Johnny ALTER TABLE记录CHANGE ID genre_id INT(10)AUTO_INCREMENT;添加auto_increment – XMen 2010-11-19 11:57:50

+0

好吧,它没有保留定义。 – Johnny 2010-11-19 11:58:41