LinuxForum.Fans
Тема

Выключается MYSQL

Автор: elfes 5 сообщений 4318 просмотров
#228681

Здравствуйте.

Поставил MYSQL, сайт работает на отлично, но, пройдя некоторое время база отключается. Бывает через 5 минут, а бывает даже через час. В чем может быть проблема?

MYSQL Version 5.1
Debian 6

Ошибка:

text
MySQL Error! 
------------------------

The Error returned was: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

В логах следующее:

/var/log/mysql/mysql.log

text
/usr/sbin/mysqld, Version: 5.1.58-1~dotdeb.1-log ((Debian)). started with:
Tcp port: 3306  Unix socket: /var/run/mysqld/mysqld.sock
Time                 Id Command    Argument

/var/log/syslog

text
Feb 11 20:04:21 sait mysqld_safe: Number of processes running now: 0
Feb 11 20:04:21 sait mysqld_safe: mysqld restarted
Feb 11 20:04:21 sait mysqld: 120211 20:04:21 [Note] Plugin 'FEDERATED' is disabled.
Feb 11 20:04:21 sait mysqld: 120211 20:04:21  InnoDB: Initializing buffer pool, size = 32.0M
Feb 11 20:04:21 sait mysqld: 120211 20:04:21  InnoDB: Completed initialization of buffer pool
Feb 11 20:04:21 sait mysqld: 120211 20:04:21  InnoDB: Started; log sequence number 0 64287
Feb 11 20:04:21 sait mysqld: 120211 20:04:21 [Note] Event Scheduler: Loaded 0 events
Feb 11 20:04:21 sait mysqld: 120211 20:04:21 [Note] /usr/sbin/mysqld: ready for connections.
Feb 11 20:04:21 sait mysqld: Version: '5.1.58-1~dotdeb.1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Debian)
Feb 11 20:04:22 sait mysqld_safe: Number of processes running now: 0
Feb 11 20:04:22 sait mysqld_safe: mysqld restarted
Feb 11 20:04:22 sait mysqld: 120211 20:04:22 [Note] Plugin 'FEDERATED' is disabled.
Feb 11 20:04:22 sait mysqld: 120211 20:04:22  InnoDB: Initializing buffer pool, size = 32.0M
Feb 11 20:04:22 sait mysqld: 120211 20:04:22  InnoDB: Completed initialization of buffer pool
Feb 11 20:04:22 sait mysqld_safe: mysqld from pid file /var/run/mysqld/mysqld.pid ended

Конфиг my.cnf

text
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
# 
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

# This will be passed to all mysql clients # It has been reported that passwords should be enclosed with ticks/quotes # escpecially if they contain "#" chars... # Remember to edit /etc/mysql/debian.cnf when changing the socket location. [client] port = 3306 socket = /var/run/mysqld/mysqld.sock

# Here is entries for some specific programs # The following values assume you have at least 32M ram

# This was formally known as [safe_mysqld]. Both versions are currently parsed. [mysqld_safe] socket = /var/run/mysqld/mysqld.sock nice = 0

[mysqld] # # * Basic Settings # user = mysql pid-file = /var/run/mysqld/mysqld.pid socket = /var/run/mysqld/mysqld.sock port = 3306 basedir = /usr datadir = /var/lib/mysql tmpdir = /tmp language = /usr/share/mysql/english skip-external-locking # # Instead of skip-networking the default is now to listen only on # localhost which is more compatible and is not less secure. # bind-address = localhost # # * Fine Tuning # key_buffer = 512M key_buffer_size = 512M max_allowed_packet = 32M thread_stack = 256K thread_cache_size = 32 # This replaces the startup script and checks MyISAM tables if needed # the first time they are touched myisam-recover = BACKUP max_connections = 1000 max_connect_errors = 10000 table_cache = 1024 thread_concurrency = 10

wait_timeout = 300 interactive_timeout = 100 concurrent_insert = 2

join_buffer_size = 8M read_buffer_size = 32M read_rnd_buffer_size = 16M net_buffer_length = 32K sort_buffer_size = 32M myisam_sort_buffer_size = 64M max_join_size = 4M tmp_table_size = 32M max_heap_table_size = 32M server-id = 1 innodb_buffer_pool_size = 32M

# # * Query Cache Configuration # query_cache_limit = 6M query_cache_size = 128M # # * Logging and Replication # # Both location gets rotated by the cronjob. # Be aware that this log type is a performance killer. # As of 5.1 you can enable the log at runtime! #general_log_file = /var/log/mysql/mysql.log #general_log = 1 # # Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf. # # Here you can see queries with especially long duration #log_slow_queries = /var/log/mysql/mysql-slow.log #long_query_time = 2 #log-queries-not-using-indexes # # The following can be used as easy to replay backup logs or for replication. # note: if you are setting up a replication slave, see README.Debian about # other settings you may need to change. #server-id = 1 #log_bin = /var/log/mysql/mysql-bin.log expire_logs_days = 10 max_binlog_size = 100M #binlog_do_db = include_database_name #binlog_ignore_db = include_database_name # # * InnoDB # # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/. # Read the manual for more InnoDB related options. There are many! # # * Security Features # # Read the manual, too, if you want chroot! # chroot = /var/lib/mysql/ # # For generating SSL certificates I recommend the OpenSSL GUI "tinyca". # # ssl-ca=/etc/mysql/cacert.pem # ssl-cert=/etc/mysql/server-cert.pem # ssl-key=/etc/mysql/server-key.pem

[mysqldump] quick quote-names max_allowed_packet = 16M

[mysql] #no-auto-rehash # faster start of mysql but no tab completition

[isamchk] key_buffer = 16M sort_buffer_size = 8M

[myisamchk] key_buffer = 8M sort_buffer_size = 8M [mysqlhotcopy] interactive-timeout

# # * IMPORTANT: Additional settings that can override those from this file! # The files must end with '.cnf', otherwise they'll be ignored. # !includedir /etc/mysql/conf.d/

debian.cfg

text
# Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host     = localhost
user     = debian-sys-maint
password = sdQWGas1234
socket   = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host     = localhost
user     = debian-sys-maint
password = FyI1OqLWHuX81kmh
socket   = /var/run/mysqld/mysqld.sock
basedir  = /usr

Помогите пожалуйста!

#228685

Верните стандартный конфиг MySQL и больше к нему не прикасайтесь.

#228687

Вот я тоже об этом подумал, что проблема в моем конфиге. Знать бы какая переменная все испортила :D

#228692
elfes написал:
Вот я тоже об этом подумал, что проблема в моем конфиге. Знать бы какая переменная все испортила :D

Навскидку max_connections, max_connect_errors, join_buffer_size, read_buffer_size, read_rnd_buffer_size, sort_buffer_size, myisam_sort_buffer_size сильно завышены. Проще вернуть дефолтный конфиг, чем с этим возиться.

#228714

Жаль, но даже возврат дефолтного конфига не помогло. Почему?!

Хотя нет, вроде перезагрузил mysql, пока не вылетает. Посмотрим еще.

Войдите или зарегистрируйтесь, чтобы ответить.