当前位置:网站首页>关系型数据库-MySQL:错误日志(log_error)
关系型数据库-MySQL:错误日志(log_error)
2022-08-04 05:26:00 【focus_lyh】
一、作用
错误日志会记录如下信息:
- mysql执行过程中的错误信息
- mysql执行过程中的警告信息
- event scheduler运行时所产生的信息
- mysql启动和停止过程中的输出信息,未必是错误信息
- 主从复制结构中,从服务器IO复制线程的启动信息
所以说,错误日志的作用不仅仅与记录错误,它是非常重要的信息日志文件。
二、配置
2.1 存放位置
mysql> show variables like "%log_error%";
+---------------+--------------------------+
| Variable_name | Value |
+---------------+--------------------------+
| log_error | /var/log/mysql/error.log |
+---------------+--------------------------+
1 row in set (0.00 sec)
或者
$ grep log_error /etc/mysql/my.cnf
log_error = /var/log/mysql/error.log
2.2 log_warning
mysql> show variables like "%log_warnings%";
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| log_warnings | 2 |
+---------------+-------+
1 row in set (0.00 sec)
或者
$ grep log_error /etc/mysql/my.cnf
log_error = /var/log/mysql/error.log
log_warnings 用于标识警告信息是否一并记录到错误日志中:
log_warnings的值为0,表示不记录警告信息。
log_warnings的值为1,表示警告信息一并记录到错误日志中。
log_warnings的值大于1,表示”失败的连接”的信息和创建新连接时”拒绝访问”类的错误信息也会被记录到错误日志中。
边栏推荐
猜你喜欢
随机推荐
JS基础--强制类型转换(易错点,自用)
thymeleaf中onclick事件动态传递参数问题
解决安装nbextensions后使用Jupyter Notebook时出现template_paths相关错误的问题
MySQL数据库(基础)
12. Paging plugin
The cost of automated testing is high and the effect is poor, so what is the significance of automated testing?
FFmpeg源码分析:avformat_open_input
程序员也应了解的Unity粒子系统
力扣:343. 整数拆分
4.2 Declarative Transaction Concept
使用express-jwt第三方包报错TypeError: expressJWT is not a function
再识关联容器
lambda函数用法总结
TSF微服务治理实战系列(一)——治理蓝图
关于 for in与for of 的差别以及如何使用
MySQL日志篇,MySQL日志之binlog日志,binlog日志详解
FLV格式详解
EntityComponentSystemSamples学习笔记
9. Dynamic SQL
8、自定义映射resultMap

![Embedded system driver primary [4] - under the basis of character device driver _ concurrency control](/img/96/5224d2de152eb738703cd201fb8407.png)







