MySQL Error
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 |
+--------------------------------------+-------+