简体   繁体   English

my.cnf文件出了什么问题

[英]what is wrong with my my.cnf file

i was trying to enable slow_query_log. 我试图启用slow_query_log。 i have downloaded my.cnf file from server using WinSCP and added the code for enabling slow_query_log. 我已经使用WinSCP从服务器下载了my.cnf文件,并添加了用于启用slow_query_log的代码。

slow_query_log = ON
slow_query_log_file = /var/log/mysql_slow.log

And when i restart my server i am getting this error mysql has failed, please contact the sysadmin (result was "mysql is not running"). 当我重新启动服务器时,我收到此错误, mysql has failed, please contact the sysadmin (result was "mysql is not running"). here i am adding my my.cnf file i have tried with slow_query_log = 1 also. 在这里,我将我的my.cnf文件我曾尝试与slow_query_log = 1也。 But getting the same error. 但是得到同样的错误。 when i remove the code which i have added the error is gone. 当我删除我添加的代码时,错误消失了。 Any one please help me... 任何人请帮助我...

my.cnf my.cnf

    [mysqld]
datadir=/home/mysql/
tmpdir=/home/mysqltmp
#max_connections = 175 #was 175
max_connections = 80
#max_connect_errors = 350 #was 250
max_connect_errors = 250
safe-show-database
skip-locking
key_buffer = 1024M # was 128M
max_allowed_packet = 6M
myisam_sort_buffer_size = 64M

#old settings, for 900 ish max maxconn
#sort_buffer_size = 32M
#read_buffer_size = 32M
#read_rnd_buffer_size = 32M

sort_buffer_size = 5M
read_buffer_size = 5M
read_rnd_buffer_size = 5M

query_cache_size= 1024M
query_cache_limit= 16M
max_heap_table_size = 128M
tmp_table_size = 128M
thread_concurrency = 16
wait_timeout = 10
innodb_file_per_table
innodb_log_file_size = 10485760
open_files_limit = 8192
low_priority_updates = 1 
slow_query_log = ON
slow_query_log_file = /var/log/mysql_slow.log

# who set these? these are NOT memory settings, but rather integer settings.
#table_cache = 1024M
#thread_cache_size = 8M

table_cache = 512
thread_cache_size = 8

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash

[isamchk]
key_buffer = 128M
sort_buffer_size = 128M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 128M
sort_buffer_size = 128M
read_buffer = 2M
write_buffer = 2M

检查所有权mysql.mysql和权限对文件/var/log/mysql_slow.log

ls -al /var/log/mysql_slow.log

create the file mysql_slow.log in /var/log & change ownerhip of the file: 在/ var / log中创建文件mysql_slow.log并更改文件的所有者:

chown mysql.mysql -R /var/log/mysql_slow.log

either value (1 or ON) should work for the slow query log. 值(1或ON)应适用于慢查询日志。

also, are you using regular statements? 另外,您是否使用常规语句?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM