mysql 简单sql语句

1.修改数据库的编码            alter database test character set utf8

 

2.创建新表    :

create table  text4(id int(10) not null primary key auto_increment,username varchar(10),pwd char(32) )

其中:primary key     主键,  auto_increment   自增 .

 

3.添加字段     [即修改alter 表]

alter add命令格式:alter table 表名 add字段 类型 其他;
例如,在表MyClass中添加了一个字段passtest,类型为int(4),默认值为0:
mysql> alter table MyClass add passtest int(4) default ‘0’;

 

4.建表时,建立分区

1)range 分区

create

 

posted @ 2017-04-10 08:34  taoing  阅读(119)  评论(0编辑  收藏  举报