mysql 錯誤日誌log error

2022-07-14 17:09:11 字數 1502 閱讀 9462

1、啟動錯誤日誌:

在不同的情況下,錯誤日誌會記錄在不同的位置,如果沒有配置檔案指定檔名,則預設為hostname.err

在mysql5.6的rpm發布的方式中,錯誤日誌被放在/var/log/mysqld.log

可以通過my.cnf檔案進行配置

[mysqld_safe]

log-error=/var/log/mysqld.log

2、檢視錯誤日誌:

mysql錯誤日誌以文字形式存放的

[root@localhost run]# echo > /var/log/mysqld.log 清空mysqld日誌檔案

[root@localhost run]# cat /var/log/mysqld.log

[root@localhost run]#service myql stop --停止mysql服務

[root@localhost run]# mysqld_safe --skip-grant-tables & 跳過授權進入mysql

[1] 3221

[root@localhost run]# 160328 09:39:08 mysqld_safe logging to '/var/log/mysqld.log'.

160328 09:39:08 mysqld_safe starting mysqld daemon with databases from /var/lib/mysql

160328 09:39:09 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

[1]+ done mysqld_safe --skip-grant-tables

[root@localhost run]#

3、檢視錯誤日誌:

[root@localhost run]# tail /var/log/mysqld.log

2016-03-28 09:39:09 3398 [error] /usr/local/mysql/bin/mysqld: can't create/write to file '/var/run/mysqld/mysqld.pid' (errcode: 2- no such file or directory)

2016-03-28 09:39:09 3398 [error] can't start server: can't create pid file: no such file or directory

160328 09:39:09 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

[root@localhost run]# perror 2 --檢視錯誤**

os error code 2: no such file or directory/

mysql錯誤日誌

lost connection to server during query 該mysql server has gone away錯誤最常見的原因是伺服器超時並關閉了連線。在這種情況下,您通常會收到以下錯誤 之一 您收到的錯誤 取決於作業系統 錯誤 描述cr server gone error 客...

Mysql 日誌管理 錯誤日誌

mysql的錯誤日誌記錄了mysqd伺服器的基本程序的執行狀態資訊。命令 配置選項 log error filen ame 呼叫flush logs時,生成新的錯誤日誌檔案,舊的檔名新增 old 字尾 命令 配置選項 log warnings 控制mysql將警告資訊也記錄到錯誤日誌檔案裡 動態系統...

mySQL 錯誤日誌分析

錯誤 130111 3 33 55 warning ip address 74.86.110.133 has been resolved to the host name 74.86.110.133 static.reverse.softlayer.com which resembles ipv4 ...