mysql錯誤日誌及sql日誌的區別

my.iniphp

#  power by phpStudy  2014  www.phpStudy.net  官網下載最新版

[client]
port=3306
[mysql]
default-character-set=utf8

[mysqld]
port=3306
basedir="E:/phpStudy/MySQL/"
datadir="E:/phpStudy/MySQL/data/"
general_log=1
general_log_file="F:/data/mysql/sql.log"
log-error="F:/data/mysql/mysql.err"
character-set-server=utf8
default-storage-engine=MyISAM
sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
max_connections=512

query_cache_size=0
table_cache=256
tmp_table_size=18M

thread_cache_size=8
myisam_max_sort_file_size=64G
myisam_sort_buffer_size=35M
key_buffer_size=25M
read_buffer_size=64K
read_rnd_buffer_size=256K
sort_buffer_size=256K

innodb_additional_mem_pool_size=2M

innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=1M

innodb_buffer_pool_size=47M
innodb_log_file_size=24M
innodb_thread_concurrency=8

#2006 - MySQL server has gone away 問題解決方法
max_allowed_packet=5120M
wait_timeout=288000
interactive_timeout=288000

log-error msyql錯誤日誌有操做系統寫入,記錄mysql啓動、退出的日誌,my.ini或命令行下臨時對log-error作配置,默認在mysql的數據目錄下產生hostname.err文件如:mysql

E:\phpStudy\MySQL\data\DESKTOP-I4OIMJC.errsql

 

sql錯誤日誌由mysqld進程寫入,記錄mysql執行過的全部sql。調試過程當中,若是應用程序由於sql錯誤致使,能夠tail -f 跟蹤到最後一條sql,即報錯sql。以前sql不可能錯誤,若是以前sql錯誤,後面sql正常狀況下應該執行不到,(小几率狀況下有可能,程序try catch對異常作了不中斷程序繼續執行的處理) spa

相關文章
相關標籤/搜索