mysql log error_mysql 配置log_error

mysql log error_mysql 配置log_error1、我在安装mysql的时候是rpm包安装的什么都是默认今天在配置错误日志的时候按照网上找的资料在[mysqld]块里面添加如下参数log_error=/path/error_filename.log重启mysql服务死活起不来。折腾了将近两个小时后来加上[client]块立马见效mysql服务启动完成。不明白为什么我的参数如下:#Foradviceonhowtoch…

1、我在安装mysql 的时候是rpm包安装的什么都是默认今天在配置错误日志的时候 按照网上找的资料

在[mysqld]块里面添加如下参数

log_error=/path/error_filename.log

重启mysql 服务 死活起不来。

折腾了将近两个小时

后来加上[client]块 立马见效 mysql 服务启动完成。  不明白为什么

我的参数如下:

# For advice on how to change settings please see

# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html

[client]

port                           = 3306

socket                         = /var/lib/mysql/mysql.sock

[mysql]

no_auto_rehash

max_allowed_packet             = 16M

prompt                         = ‘\u@\h [\d]> ‘

default_character_set          = utf8                                # Possibly this setting is correct for most recent Linux systems

[mysqldump]

max_allowed_packet             = 16M

[mysqld_safe]

open_files_limit               = 8192                                # You possibly have to adapt your O/S settings as well

user                           = mysql

log-error                      = error.log

[mysqld]

# Remove leading # and set to the amount of RAM for the most important data

# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.

# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging

# changes to the binary log between backups.

# log_bin

# These are commonly set, remove the # and set as required.

# basedir = …..

# datadir = …..

# port = …..

# server_id = …..

# socket = …..

# Remove leading # to set options mainly useful for reporting servers.

# The server defaults are faster for transactions and fast SELECTs.

# Adjust sizes as needed, experiment to find the optimal values.

# join_buffer_size = 128M

# sort_buffer_size = 2M

# read_rnd_buffer_size = 2M

# Connection and Thread variables

port                           = 3306

socket                         = /var/lib/mysql/mysql.sock

max_allowed_packet             = 16M

default_storage_engine         = InnoDB                              # Defaults since 5.5

# character_set_server           = utf8                                # If you prefer utf8

# collation_server               = utf8_general_ci

max_connections                = 151                                 # Values < 1000 are typically good

max_user_connections           = 50                                  # Limit one specific user/application

thread_cache_size              = 151                                 # Up to max_connections makes sense

# Query Cache

query_cache_type               = 1                                   # Set to 0 to avoid global QC Mutex

query_cache_size               = 64M                                 # Avoid too big (> 128M) QC because of QC clean-up lock!

# Session variables

sort_buffer_size               = 2M                                  # Could be too big for many small sorts

tmp_table_size                 = 32M                                 # Make sure your temporary results do NOT contain BLOB/TEXT attributes

read_buffer_size               = 128k                                # Resist to change this parameter if you do not know what you are doing

read_rnd_buffer_size           = 256k                                # Resist to change this parameter if you do not know what you are doing

join_buffer_size               = 128k                                # Resist to change this parameter if you do not know what you are doing

# Other buffers and caches

table_definition_cache         = 400                                 # As big as many tables you have

table_open_cache               = 400                                 # connections x tables/connection (~2)

# MySQL error log

log_error                      = /data/errorlog/error.log

log_warnings                   = 2

# innodb_print_all_deadlocks     = 1

# wsrep_log_conflicts            = 1                                   # for Galera only!

# Slow Query Log

slow_query_log_file            = slow.log

slow_query_log                 = 0

log_queries_not_using_indexes  = 1

long_query_time                = 0.5

min_examined_row_limit         = 100

# General Query Log

general_log_file               = general.log

general_log                    = 0

# Binary logging and Replication

server_id                      = 42

log_bin                        = mysql-bin

binlog_cache_size              = 1M

说明在配置log_error 参数的时候一定要配置[client]块

但不知道为什么 ,有待研究.

[client] 是所有mysql客户端程序读取的配置块。[server]是所有服务端如mysqld会读取的配置块。[mysqldump]则是只有 mysqldump 才会读取的配置文件,[mysql] 是mysql这个客户端程序的配置块,而[mysqld]是mysql服务端程序mysqld 和 mysqld_safe ,mysqld_multi 的配置文件。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26764973/viewspace-1444960/,如需转载,请注明出处,否则将追究法律责任。

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/37413.html

(0)
编程小号编程小号

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注