建表语句,带自增字段
create table test ( id int auto_increment primary key, name varchar(20) not null, password varchar(20) not null );
MySQL数据库修改id字段自增
alter table table_name modify column col_name int auto_increment;
显示表结构方法:
desc table_name; describe table_name; show columns from table_name; explain table_name;
还可以使用mysql的工具mysqlshow.exe,不用登录
>mysqlshow db_name table_name