当前位置:网站首页>MySQL log error log
MySQL log error log
2022-07-27 20:37:00 【Hua Weiyun】
28.3 Error log
MySQL Is recorded in the error log of MySQL All error messages during operation , see MySQL The error log of can help database maintainers to better troubleshoot MySQL Server failure .
28.3.1 Open error log
Can be in my.cnf Documents or my.ini The error log function is configured in the file .
[mysqld]log_error = /data/mysql/log/error_log/mysql-error.logamong ,log_error Indicates the location of the error log file . If not for log_error assignment , be MySQL The default will be DATADIR Specified directory (MySQL Data storage directory ) Next create a host_name.err File to record MySQL Error log for .
After successful configuration , It needs to be reopened MySQL The server will take effect .
Be careful :MySQL Does not support the MySQL The command line executes the following command to start the error log .
mysql> SET GLOBAL log_error = '/data/mysql/log/error_log/mysql-error.log';ERROR 1238 (HY000): Variable 'log_error' is a read only variableRestart MySQL After the server , see /data/mysql/log/error_log A file in a directory .
[[email protected] ~]# ll /data/mysql/log/error_log/total 4-rw-r----- 1 mysql mysql 354 Jan 17 14:22 mysql-error.logResults show ,data/mysql/log/error_log The directory has been successfully generated mysql-error.log file .
28.3.2 Check the error log
MySQL The error log file of is stored on the disk of the server in the format of plain text file , You can directly view the contents of the file .
(1) towards t_goods_category Insert data into the data table , And make SQL Statement error .
mysql> INSERT INTO t_goods_category -> (id, t_category) -> VALUES -> ('mysql', 'mysql');ERROR 1366 (HY000): Incorrect integer value: 'mysql' for column 'id' at row 1(2) see MySQL Error log file .
cat /data/mysql/log/error_log/ mysql-error.log################ Omit n Line logs #######################2020-01-17T07:02:53.958135Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.112020-01-17T07:02:53.959012Z 0 [Note] InnoDB: Number of pools: 12020-01-17T07:02:53.960377Z 0 [Note] InnoDB: Not using CPU crc32 instructions2020-01-17T07:02:53.966535Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M2020-01-17T07:02:53.977288Z 0 [Note] InnoDB: Completed initialization of buffer pool2020-01-17T07:02:54.060328Z 0 [Note] InnoDB: Highest supported file format is Barracuda.2020-01-17T07:02:56.286598Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.2020-01-17T07:02:56.287290Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.2020-01-17T07:02:56.288285Z 0 [Note] InnoDB: Waiting for purge to start28.3.3 Delete error log
MySQL The error log of can also be deleted directly like the query log and slow query log , If you need to regenerate the log file , It's in MySQL Command line execution FLUSH LOGS command , Execute on the server command line mysqladmin flush-logs command .
(1) Delete error log .
rm -rf /data/mysql/log/error_log/mysql-error.logsee /data/mysql/log/error_log/ A file in a directory .
[[email protected] ~]# ll /data/mysql/log/error_log/total 0Results show ,mysql-error.log The file has been deleted .
(2) Refresh log file .
mysql> FLUSH LOGS; Query OK, 0 rows affected (0.01 sec)Or execute the following command on the server command line to refresh the log .
[[email protected] ~]# mysqladmin -uroot -p flush-logsEnter password:Look again /data/mysql/log/error_log/ A file in a directory .
[[email protected] ~]# ll /data/mysql/log/error_log/total 4-rw-r----- 1 mysql mysql 354 Jan 17 15:18 mysql-error.logAfter refreshing the log ,MySQL The error log file will be regenerated .
28.3.4 Close the error log
close MySQL Error log for , Only need to my.cnf Documents or my.ini In the document log_error Configuration Item Deletion , And turn it back on MySQL that will do . Readers can practice by themselves , No more details here .
边栏推荐
- Passive income: return to the original and safe two ways to earn
- Check the internship salary of Internet companies: with it, you can also enter the factory
- Redis queue, RDB learning
- Scrollintoview realizes simple anchor location (example: select city list)
- To share the denoising methods and skills of redshift renderer, you must have a look
- (manual) [sqli labs38, 39] stack injection, error echo, character / number type
- Use cpolar to build a business website (5)
- JD: search product API by keyword
- 2022.07.11
- 发布2年后涨价100美元,Meta Quest 2的逆生长
猜你喜欢

Standing on the shoulders of giants to learn, jd.com's popular architect growth manual was launched

C language -- array

Interviewer: what is the abstract factory model?

【效率】弃用 Notepad++,这款开源替代品更牛逼!

Understand │ what is cross domain? How to solve cross domain problems?

办公自动化解决方案——DocuWare Cloud 将应用程序和流程迁移到云端的完整的解决方案

Ten year test old bird talk about mobile terminal compatibility test

My approval of OA project (Query & meeting signature)

Anfulai embedded weekly report no. 275: 2022.07.18--2022.07.24

OA项目之我的审批(查询&会议签字)
随机推荐
In 2019, the global semiconductor market revenue was $418.3 billion, a year-on-year decrease of 11.9%
Adjust the array so that odd numbers all precede even numbers
ES6 -- Application of expansion operator
js跳转页面并刷新(本页面跳转)
Two years after its release, the price increased by $100, and the reverse growth of meta Quest 2
[map set]
slf4j简介说明
Huawei's mobile phone shipments exceed Apple's, ranking second in the world, but it faces a large amount of inventory that needs to be cleaned up
EasyCVR平台关闭录像为何还会有TS切片文件生成?
Redis hash structure command
API for obtaining the latest raw data of Taobao app product details
How to run kevinchappell / FormBuilder
Ten year test old bird talk about mobile terminal compatibility test
Injection attack
调整数组使奇数全部都位于偶数前
Get wechat product details API
Understand the wonderful use of dowanward API, and easily grasp kubernetes environment variables
软件测试面试题:已知一个数字为1,如何输出“0001
ES6 -- Deconstruction assignment
What is a multi-layer perceptron (what is a multi-layer perceptron)