[MySQL] Create Table with Auto Incremental

By | Y2014Y2014-8M-D

Example>

use foodfavor;
create table food (
  pk1 MEDIUMINT NOT NULL AUTO_INCREMENT,
  food_id char(50),
  food_name CHAR(255) NOT NULL,
  PRIMARY KEY (pk1)
);

* reference:
http://dev.mysql.com/doc/refman/5.0/en/example-auto-increment.html
MyISAM Or InnoDB MySQL engine?: http://linuxers.org/howto/myisam-or-innodb-mysql-engine

 

1,327 total views, 1 views today

댓글 남기기