mysql log error_mysql 配置log_error

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/,如需转载,请注明出处,否则将追究法律责任。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值