摘要: 一、数学函数 1、求绝对值abs() select abs(num) from tableName where .... 2、向下取整floor(),例如:99.9→99 select floor(num) from tableName where ...; 3、向上取整 ceil(),例如99.9 阅读全文
posted @ 2022-02-23 23:00 小李不背锅 阅读(37) 评论(0) 推荐(0) 编辑
摘要: 1、新增字段 alter table 表名称 add 字段名称 数据类型; 2、修改字段 alter table 表名称 change 旧字段 新字段 数据类型; 3、删除字段 alter table 表名称 drop 字段名; 4、设置字段默认值 alter table 表名称 alter col 阅读全文
posted @ 2022-02-23 22:32 小李不背锅 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 日期与时间类型: 数据类型 大小 描述 year 1byte 年份值 date 3byte 日期值 time 3byte 时间值 datetime 8byte 日期+时间值 timestamp 4byte 1970-1-1 00:00:01 到目前的毫秒数 字符串类型: 数据类型 大小 描述 cha 阅读全文
posted @ 2022-02-23 21:52 小李不背锅 阅读(21) 评论(0) 推荐(0) 编辑
摘要: 在我们使用宝塔面板的过程中,有可能遇到过这种情况,新增数据库时出现数据库管理密码错误这个问题,我在找问题的过程中发现了一个不太常见的问题,那就是root用户丢失了。 查看root用户是否丢失可以在MySQL里面查看, use mysql; select user,host from user; 如果 阅读全文
posted @ 2022-02-23 15:23 小李不背锅 阅读(1135) 评论(0) 推荐(0) 编辑
摘要: 原文出处: 误删root用户 阅读全文
posted @ 2022-02-23 11:02 小李不背锅 阅读(33) 评论(0) 推荐(0) 编辑