MySQL Error:修订间差异
无编辑摘要 |
无编辑摘要 |
||
第48行: | 第48行: | ||
* 1 or MEDIUM 验证长度、数字、大小写、特殊字符 | * 1 or MEDIUM 验证长度、数字、大小写、特殊字符 | ||
* 2 or STRONG 验证长度、数字、大小写、特殊字符、字典文件 | * 2 or STRONG 验证长度、数字、大小写、特殊字符、字典文件 | ||
SHOW VARIABLES LIKE 'validate_password%'; | SHOW VARIABLES LIKE 'validate_password%'; | ||
{| class="wikitable" | |||
|Variable_name | |||
|Value | |||
| Variable_name | |- | ||
|validate_password.check_user_name | |||
|ON | |||
|- | |||
| validate_password.check_user_name | |validate_password.dictionary_file | ||
| | |||
| validate_password.dictionary_file | |- | ||
|validate_password.length | |||
| validate_password.length | |8 | ||
|- | |||
| validate_password.mixed_case_count | |validate_password.mixed_case_count | ||
|1 | |||
| validate_password.number_count | |- | ||
|validate_password.number_count | |||
| validate_password.policy | |1 | ||
|- | |||
| validate_password.special_char_count | 1 | |validate_password.policy | ||
|MEDIUM | |||
|- | |||
|validate_password.special_char_count | |||
|1 | |||
|} | |||
set global validate_password.policy=0; | set global validate_password.policy=0; | ||
{| class="wikitable" | |||
|Variable_name | |||
|Value | |||
| Variable_name | |- | ||
|validate_password.check_user_name | |||
|ON | |||
|- | |||
| validate_password.check_user_name | |validate_password.dictionary_file | ||
| | |||
| validate_password.dictionary_file | |- | ||
|validate_password.length | |||
| validate_password.length | |8 | ||
|- | |||
| validate_password.mixed_case_count | |validate_password.mixed_case_count | ||
|1 | |||
| validate_password.number_count | |- | ||
|validate_password.number_count | |||
| validate_password.policy | |1 | ||
|- | |||
| validate_password.special_char_count | 1 | |validate_password.policy | ||
|LOW | |||
|- | |||
|validate_password.special_char_count | |||
|1 | |||
|} | |||
==== Cannot convert string from utf8mb4 to binary ==== | ==== Cannot convert string from utf8mb4 to binary ==== | ||
[https://bugs.mysql.com/bug.php?id=110955#:~:text=Description%3A%20Union%20all%20derived%20table%20query%20error%3A%20Warning,others%20This%20problem%20does%20not%20exist%20in%208.0.31. | [https://bugs.mysql.com/bug.php?id=110955#:~:text=Description%3A%20Union%20all%20derived%20table%20query%20error%3A%20Warning,others%20This%20problem%20does%20not%20exist%20in%208.0.31. 官方已确认是 8.0.32 中的一个bug,已在 8.0.33 版本中修复。] | ||
对于 8.0.32 版本 | 对于 8.0.32 版本 |
2023年11月22日 (三) 23:12的版本
MySQL Error
使用关键字做字段名
如下面SQL中的 condition, 这样会报错,需要加上 "`"
或者可以将所有字段都加上,如:
select id, area,`condition`, condition_code
from ods.t1
ERROR 1418 (HY000)
This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
开启bin-log, 函数中需要指定操作:
- DETERMINISTIC 确定的
- NO SQL 没有SQl语句
- READS SQL DATA 只是读取数据
(以上支持)
- MODIFIES SQL DATA 要修改数据
- CONTAINS SQL 包含了SQL语句
1261 - Row XX doesn’t contain data for all colums
mysql报1261或1262错误主要是由于mysql中的sql_mode严格设置。需要将mysql_mode修改。
首先select @@sql_mode查看目前mode类型;select @@global.sql_mode是查看全局设置。
搜索sql_mode,将strict_trans_tables删除,或者设置为空
sql-mode=“NO_UNSIGNED_SUBTRACTION,NO_ENGINE_SUBSTITUTION”
重启mysql服务, mysql net stop; mysql net restart;
2013, Lost connection to MySQL server during query
net_read_timeout 和 net_write_timeout :控制一次连接传输数据等待的时间,默认是 30s.
max_allowed_packet : 数据传输中使用了较大的 string filed 或者 blob filed,导致超过了max_allowed_packet
wait_timeout :The number of seconds the server waits for activity on a noninteractive connection before closing it. 如果MySQL 配置的比应用低,就会出现应用程序中认为一个连接还没有到回收的时间,但是 MySQL 自己判断需要强制回收了。
ERROR 1819 (HY000)
Your password does not satisfy the current policy requirements
- 0 or LOW 只验证长度
- 1 or MEDIUM 验证长度、数字、大小写、特殊字符
- 2 or STRONG 验证长度、数字、大小写、特殊字符、字典文件
SHOW VARIABLES LIKE 'validate_password%';
Variable_name | Value |
validate_password.check_user_name | ON |
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 |
set global validate_password.policy=0;
Variable_name | Value |
validate_password.check_user_name | ON |
validate_password.dictionary_file | |
validate_password.length | 8 |
validate_password.mixed_case_count | 1 |
validate_password.number_count | 1 |
validate_password.policy | LOW |
validate_password.special_char_count | 1 |
Cannot convert string from utf8mb4 to binary
官方已确认是 8.0.32 中的一个bug,已在 8.0.33 版本中修复。
对于 8.0.32 版本
show variables LIKE '%optimizer_switch%'; set global optimizer_switch="...,derived_condition_pushdown=off";