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 的配置檔案。
在[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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- mysql配置MySql
- 配置mysqlMySql
- Mysql安全配置MySql
- MySQL基本配置MySql
- MySQL MHA配置MySql
- Mac 下配置 MySQLMacMySql
- mysql大頁配置MySql
- mysql主從配置MySql
- MySQL安裝配置MySql
- MySQL配置檔案MySql
- mysql 主從配置MySql
- mysql 配置檔案MySql
- Mysql半同步配置MySql
- rails 配置使用mysqlAIMySql
- MySQL之swap配置MySql
- MYSQL 配置slave故障MySql
- MySQL叢集配置MySql
- mysql配置主從MySql
- Mysql 安裝 配置MySql
- Mysql管理與配置MySql
- mysql配置詳解MySql
- MySQL多例項配置MySql
- MYSQL + MHA +keepalive + VIP安裝配置(一)--MYSQL安裝配置MySql
- mysql--my.ini配置檔案配置MySql
- 【mysql】CentOS離線安裝配置MySqlMySqlCentOS
- mysql_to_mysql的gg簡單配置MySql
- 【Mysql】Windows下安裝和配置MysqlMySqlWindows
- JPA配置mysql連線MySql
- 【MySQL】安裝與配置MySql
- MySQL安全配置基線MySql
- MySQL主從同步配置MySql主從同步
- docker mysql 主從配置DockerMySql
- MySQL配置與啟動MySql
- MySQL安裝與配置MySql
- windows配置MySql服務WindowsMySql
- oracle to mysql的gg配置OracleMySql
- mysql my.cnf 配置MySql
- mysql cluster 簡單配置MySql