#查看所有数据库showdatabases#查看当前的数据库selectdatabase()#使用编码utf8 创建 test 数据库createdatabase test charset=utf8
#删除 test 数据库dropdatabase test
#进入数据库use test
#查看当前数据库中所有表showtables
#查看表结构desc test
#添加列altertable text01 add(remark varchar(40)default'无')#修改列类型和列名altertable text01 change remark remark varchar(30)default'暂无'#删除列altertable text01 drop remark
#创建表createtable text01(
id int(22)primarykeyAUTO_INCREMENT,
username varchar(20)notnull,
sex varchar(5)notnullcheck,
age int(2)notnull)ENGINE=InnoDBDEFAULTCHARSET=utf8;ENGINE=InnoDB#数据库存储引擎DEFAULT#默认CHARSET=utf8 #数据库字符编码notnull#非空unique#不能重复check#检查约束default'没有'#默认约束