> ### ***字段類型***
```
char 0-255字節 定長字符串
varchar 0-65535 字節 變長字符串
text 0-65535字節 長文本數據
longtext 0-4294967295字節 極大文本數據
tinyint 1 字節 (-128,127) (0,255) 小整數值
smallint 2 字節 (-32 768,32767) (0,65535) 大整數值
mediumint 3 字節 (-8388 608,8388607) (0,16777215) 大整數值
int 4 字節 (-2 147483 648,2147483647) (0,4294967295) 大整數值
float 4 字節 單精度浮點數值
```
*****
> #### ***char與varchar***
```
char最長255,varchar最長65535
char固定長度空間,varchar可變長度空間(實際空間加1)
```
*****
> #### ***數字字段***
```
unsigned 無符號
zerofill 用0填充
auto_increment 自動增長
null
not null
default 默認值
comment 注釋
```
*****
```
create user 'admin'@'localhost' identified by '123456';#創建用戶
grant select,insert,update,delete on 數據庫.* to 'admin' @'%';#為用戶賦值權限
drop user 'admin'@'localhost';#刪除用戶
truncate tablename; #清空表中的數據命令
show table status from databasename; #查看數據庫的詳細信息
desc select * from table where **; #可以查看mysql所用的時間
desc select * from table where ** \G #用列來看表數據
show engines;#查看支持引擎
show variables like '%storage_engine%';#查看當前使用的引擎
show plugins;#查看mysql是否支持分區表
show create table tableName;#查看表的引擎
alter table tableName engine=innodb;#修改表的引擎
show create database dbName;#查看數據庫的結構
```