MySQL 中的默认数据库介绍:https://dataedo.com/kb/databases/mysql/default-databases-schemas 默认数据库 官方文档 information_schema https://dev.mysql.com/doc/refman/8.0/en/information-schema.html mysql performance_schema https://dev.mysql.com/doc/refman/8.0/en/performanc…
问题描述: 在mysql中 user表中新增用户默认密码为123456,但是在数据库中显示不能为明文,而mysql的默认字段不能用函数 解决方法: 用触发器 delimiter | drop trigger if exists default_user_pwd;create trigger default_user_pwd before insert on user for each row if (new.pwd is null or new.pwd ='' or new.pwd ='123…
1) 什么是Cardinality 不是所有的查询条件出现的列都需要添加索引.对于什么时候添加B+树索引.一般的经验是,在访问表中很少一部分时使用B+树索引才有意义.对于性别字段.地区字段.类型字段,他们可取值范围很小,称为低选择性.如 SELECT * FROM student WHERE sex='M' 按性别进行查询时,可取值一般只有M.F.因此SQL语句得到的结果可能是该表50%的数据(加入男女比例1:1)这时添加B+树索引是完全没有必要的.相反,如果某个字段的取值范围很…