摘要: 一、为什么用自增列作为主键 1、如果我们定义了主键(PRIMARY KEY),那么InnoDB会选择主键作为聚集索引。 如果没有显式定义主键,则InnoDB会选择第一个不包含有NULL值的唯一索引作为主键索引。 如果也没有这样的唯一索引,则InnoDB会选择内置6字节长的ROWID作为隐含的聚集索引 阅读全文
posted @ 2021-07-05 15:25 干饭人~ 阅读(309) 评论(0) 推荐(0) 编辑
摘要: MySQL常见问题 1. Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column. mysql删除记录报错 展示非主 阅读全文
posted @ 2021-07-05 15:03 干饭人~ 阅读(40) 评论(0) 推荐(0) 编辑
摘要: MySQL添加索引: 使用某数据库 scheam use ua; show tables; 查看表结构 desc ua.log; 查看索引 show index from ua.log; 添加组合索引 ALTER TABLE `log` ADD INDEX index_log_type ( `log 阅读全文
posted @ 2021-07-05 14:08 干饭人~ 阅读(49) 评论(0) 推荐(0) 编辑