日期:2014-05-16  浏览次数:20739 次

mysql 创建表并设置主键自增
  1. mysql?创建表:??
  2. ???
  3. mysql>?create?table?user(??
  4. ????->?userid?int ( 4 )?primary?key?not? null ?auto_increment,??
  5. ????->?username?varchar(16 )?not? null ,??
  6. ????->?userpassword?varchar(32 )?not? null ??
  7. ????->?);??
  8. ???
  9. ???
  10. ???
  11. create?table?log(??
  12. logid?int ( 4 )?primary?key?not? null ?auto_increment,??
  13. logtitle?varchar(32 )?not? null ,??
  14. logcontent?varchar(160 )?not? null ,??
  15. logtime?datetime?not?null ,??
  16. userip?varchar(64 )?not? null ??
  17. );?