/assets/avatar/fat-gopher-tiny.png

tangx

Mysql 基础练习 01

Mysql 基础练习 01 根据表格创建数据库表,注意编码。 createdatabasedb01defaultcharsetutf8collateutf8_general_ci;usedb01;createtableuserinfo(idintnotnullauto_incrementprimarykey,namevarchar(32)notnull,passwordvarchar(64)notnull,genderenum('male','female')notnull,emailvarchar(64)notnull,amountdecimal(10,2)notnulldefault0,ctimedatetime)defaultcharset=utf8;showtables;+----------------+ |Tables_in_db01|+----------------+ |userinfo|+----------------+ 1rowinset 插入任意五条数据 insertintouserinfo(name,`password`,gender,email)values("zhangsan","zhang123","male","zhangsan@example.com");insertintouserinfo(name,`password`,gender,email)values("murong","murong123","female","murong@example.com");insertintouserinfo(name,`password`,gender,email,amount)values("waner","waner123","female","waner@example.com",1234.123);insertintouserinfo(name,`password`,gender,email,amount)values("wangwu","wangwu123","male","wangwu@example.com",3432.23);insertintouserinfo(name,`password`,gender,email,amount)values("wangyuyan","wang123","female","wangyuyan@example.com",394023);select*fromuserinfo;+----+-----------+-----------+--------+-----------------------+-----------+--------+ |id|name|password|gender|email|amount|ctime|+----+-----------+-----------+--------+-----------------------+-----------+--------+ |1|zhangsan|zhang123|male|zhangsan@example.com|0.00|<null>||2|murong|murong123|female|murong@example.com|0.00|<null>||3|waner|waner123|female|waner@example.com|1234.12|<null>||4|wangwu|wangwu123|male|wangwu@example.com|3432.23|<null>||5|wangyuyan|wang123|female|wangyuyan@example.com|394023.00|<null>|+----+-----------+-----------+--------+-----------------------+-----------+--------+ (END)非法数据: 由于 gender 列使用的是 enum , 只能接受 male / female。

Mysql 常见数据类型 int char timestamp

Mysql 数据类型 https://dev.mysql.com/doc/refman/5.7/en/data-types.html 整数类型 mysqlroot@localhost:db1>createtabletable_int(int_nointunsigned,biging_nobigint,tinyint_notinyint)defaultcharset=utf8;QueryOK,0rowsaffectedTime:0.028sint 取值范围 -2^31 ~ 2^31-1 unsigned : 取之范围 0 ~ 2^32-1 bigint 取值范围 -2^63 ~ 2^63-1 tinyint 取值范围 -128 ~ 127 小数类型 Float 使用 32位浮点数保存。 不精确。 Double 使用 64 位浮点

gin 实现首页不缓存

在 gin 中实现首页不缓存 之前提到了在 nginx 中添加响应头 Cache-Control: no-cache 不缓存首页, 以便每次发布 CDN 都能回源到最新的资源。 nginx 的配置可能都是实施人员的操作, 或许不在掌

配置文件初始化思路一二三

配置文件初始化思路要点一二三 配置文件字段如下 type Config struct { Server Server `json:"server,omitempty" yaml:"server,omitempty"` Ingresses netv1.IngressSpec `json:"ingresses,omitempty" yaml:"ingresses,omitempty"` } 完整配置如下 server:port:8080ingresses:rules:- host:www.baidu.comhttp:paths:- backend:service:name:/searchport:number:80pathType:ImplementationSpecific# pathType: Exact# pathType: PrefixConfig 文件 读取多个文件后合并最终结果。 可以将不同的