- 查看密码强度规则 show variables like “%password%”;
±---------------------------------------------±----------------+
| Variable_name | Value |
±---------------------------------------------±----------------+
| caching_sha2_password_auto_generate_rsa_keys | ON |
| caching_sha2_password_private_key_path | private_key.pem |
| caching_sha2_password_public_key_path | public_key.pem |
| default_password_lifetime | 0 |
| disconnect_on_expired_password | ON |
| mysql_native_password_proxy_users | OFF |
| password_history | 0 |
| password_require_current | OFF |
| password_reuse_interval | 0 |
| report_password | |
| sha256_password_auto_generate_rsa_keys | ON |
| sha256_password_private_key_path | private_key.pem |
| sha256_password_proxy_users | OFF |
| sha256_password_public_key_path | public_key.pem |
±---------------------------------------------±----------------+
如果有安装validata_password插件,还会有如下信息
| validate_password_check_user_name | OFF |
| validate_password_dictionary_file | |
| validate_password_length | 8 |
| validate_password_mixed_case_count | 1 |
| validate_password_number_count | 1 |
| validate_password_policy | MEDIUM |
| validate_password_special_char_count | 1 |
±--------------------------------------±-------+
参数说明:
validate_password_length: 最小长度8位
validate_password_mixed_case_count: 至少要包含的大写字母数和小写字母数,都是1
validate_password_number_count:至少要包含的数字个数,1
validate_password_special_char_count : 至少要包含的特殊字符个数,1
validate_password_policy:密码强度检查等级,0/LOW,1/MEDIUM(默认值),2/STRONG
- 开启各种执行计划选择信息(mysql默认是关闭的) SET optimizer_trace=‘enabled=on’; 这里我要查看一条排序查询语句的信息
/* @a 保存 Innodb_rows_read 的初始值 /
SELECT VARIABLE_VALUE into @a from performance_schema.session_status where variable_name = ‘Innodb_rows_read’;
/ 执行语句 /
SELECT city,name,age from t where city=‘杭州’ ORDER BY name limit 1000;
/ 查看 OPTIMIZER_TRACE 输出 /
SELECT * FROM information_schema.OPTIMIZER_TRACE\G;
/ @b 保存 Innodb_rows_read 的当前值 /
select VARIABLE_VALUE into @b from performance_schema.session_status where variable_name = ‘Innodb_rows_read’;
/ 计算 Innodb_rows_read 差值 */
select @b - @a;