Все технические форумы на одном сайте Удобный поиск информации с популярных форумов в одном месте
Вопрос: django останавливает Mysql

Здравствуйте, у меня виртуальный хостинг, на нем два сайта один php другой python. Здесь работает связка nginx + mysql. И в данном случае mysql работает только с php, но работал и с сайтом django python, но потом когда начались проблемы я его перевел на sqlite. А проблемы вот в чем когда я запуская сервер на котором работает djangо и не важно это manage.py runserver это тестовый сервер или uwsgi то при их запуске останавливается mysql, хотя сайт уже не использует мускл. Я понимаю что проблема в коде django, но я так думаю можно узнать причину остановки из логов mysql, поэтому обращаюсь сюда. Поэтому вылаживаю настройки и логи, буду признателен за помощь.
#
# 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            = 3307
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            = 3307
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
lc-messages-dir = /usr/share/mysql
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            = 127.0.0.1
#
# * Fine Tuning
#
key_buffer              = 16M
max_allowed_packet      = 16M
thread_stack            = 192K
thread_cache_size       = 20 #8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover-options  = BACKUP
max_connections        = 100   #
#table_cache            = 64
#thread_concurrency     = 10
#
# * Query Cache Configuration
#
query_cache_limit       = 10M #1
query_cache_size        = 16M
#
# * 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 log - should be very few entries.
#
log_error = /var/log/mysql/error.log
#
# Here you can see queries with especially long duration
#slow_query_log = 1
#slow_query_log_file = /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      = 36M #/16

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

[isamchk]
key_buffer              = 36M #/16

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


innodb_buffer_pool_size=4G
innodb_buffer_pool_instances=2
innodb_read_io_threads=12
innodb_write_io_threads=12
innodb_io_capacity=300
innodb_log_file_size=128M
innodb_flush_method            = O_DIRECT
innodb_log_files_in_group      = 2
innodb_flush_log_at_trx_commit = 1
innodb_file_per_table          = 1

!includedir /etc/mysql/conf.d/




root@crackkc:/var/log/mysql# cat error.log
2015-08-24 01:35:09 13904 [Note] Plugin 'FEDERATED' is disabled.
2015-08-24 01:35:09 13904 [ERROR] Function 'innodb' already exists
2015-08-24 01:35:09 13904 [Warning] Couldn't load plugin named 'innodb' with soname 'ha_innodb.so'.
2015-08-24 01:35:09 13904 [ERROR] Function 'federated' already exists
2015-08-24 01:35:09 13904 [Warning] Couldn't load plugin named 'federated' with soname 'ha_federated.so'.
2015-08-24 01:35:09 13904 [ERROR] Function 'blackhole' already exists
2015-08-24 01:35:09 13904 [Warning] Couldn't load plugin named 'blackhole' with soname 'ha_blackhole.so'.
2015-08-24 01:35:09 13904 [ERROR] Function 'archive' already exists
2015-08-24 01:35:09 13904 [Warning] Couldn't load plugin named 'archive' with soname 'ha_archive.so'.
2015-08-24 01:35:09 13904 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-08-24 01:35:09 13904 [Note] InnoDB: The InnoDB memory heap is disabled
2015-08-24 01:35:09 13904 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-08-24 01:35:09 13904 [Note] InnoDB: Memory barrier is not used
2015-08-24 01:35:09 13904 [Note] InnoDB: Compressed tables use zlib 1.2.7
2015-08-24 01:35:09 13904 [Note] InnoDB: Using Linux native AIO
2015-08-24 01:35:09 13904 [Note] InnoDB: Not using CPU crc32 instructions
2015-08-24 01:35:09 13904 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-08-24 01:35:09 13904 [Note] InnoDB: Completed initialization of buffer pool
2015-08-24 01:35:09 13904 [Note] InnoDB: Highest supported file format is Barracuda.
2015-08-24 01:35:09 13904 [Note] InnoDB: 128 rollback segment(s) are active.
2015-08-24 01:35:09 13904 [Note] InnoDB: Waiting for purge to start
2015-08-24 01:35:09 13904 [Note] InnoDB: 5.6.25 started; log sequence number 54580288
2015-08-24 01:35:09 13904 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
2015-08-24 01:35:09 13904 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
2015-08-24 01:35:09 13904 [Note] Server socket created on IP: '127.0.0.1'.
2015-08-24 01:35:09 13904 [Note] Event Scheduler: Loaded 0 events
2015-08-24 01:35:09 13904 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.6.25-1~dotdeb+7.1-log'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Debian)
2015-08-24 01:35:15 14034 [Note] Plugin 'FEDERATED' is disabled.
2015-08-24 01:35:15 14034 [ERROR] Function 'innodb' already exists
2015-08-24 01:35:15 14034 [Warning] Couldn't load plugin named 'innodb' with soname 'ha_innodb.so'.
2015-08-24 01:35:15 14034 [ERROR] Function 'federated' already exists
2015-08-24 01:35:15 14034 [Warning] Couldn't load plugin named 'federated' with soname 'ha_federated.so'.
2015-08-24 01:35:15 14034 [ERROR] Function 'blackhole' already exists
2015-08-24 01:35:15 14034 [Warning] Couldn't load plugin named 'blackhole' with soname 'ha_blackhole.so'.
2015-08-24 01:35:15 14034 [ERROR] Function 'archive' already exists
2015-08-24 01:35:15 14034 [Warning] Couldn't load plugin named 'archive' with soname 'ha_archive.so'.
2015-08-24 01:35:15 14034 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-08-24 01:35:15 14034 [Note] InnoDB: The InnoDB memory heap is disabled
2015-08-24 01:35:15 14034 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-08-24 01:35:15 14034 [Note] InnoDB: Memory barrier is not used
2015-08-24 01:35:15 14034 [Note] InnoDB: Compressed tables use zlib 1.2.7
2015-08-24 01:35:15 14034 [Note] InnoDB: Using Linux native AIO
2015-08-24 01:35:15 14034 [Note] InnoDB: Not using CPU crc32 instructions
2015-08-24 01:35:15 14034 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-08-24 01:35:15 14034 [Note] InnoDB: Completed initialization of buffer pool
2015-08-24 01:35:16 14067 [Note] Plugin 'FEDERATED' is disabled.
2015-08-24 01:35:16 14067 [ERROR] Function 'innodb' already exists
2015-08-24 01:35:16 14067 [Warning] Couldn't load plugin named 'innodb' with soname 'ha_innodb.so'.
2015-08-24 01:35:16 14067 [ERROR] Function 'federated' already exists
2015-08-24 01:35:16 14067 [Warning] Couldn't load plugin named 'federated' with soname 'ha_federated.so'.
2015-08-24 01:35:16 14067 [ERROR] Function 'blackhole' already exists
2015-08-24 01:35:16 14067 [Warning] Couldn't load plugin named 'blackhole' with soname 'ha_blackhole.so'.
2015-08-24 01:35:16 14067 [ERROR] Function 'archive' already exists
2015-08-24 01:35:16 14067 [Warning] Couldn't load plugin named 'archive' with soname 'ha_archive.so'.
2015-08-24 01:35:16 14067 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-08-24 01:35:16 14067 [Note] InnoDB: The InnoDB memory heap is disabled
2015-08-24 01:35:16 14067 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-08-24 01:35:16 14067 [Note] InnoDB: Memory barrier is not used
2015-08-24 01:35:16 14067 [Note] InnoDB: Compressed tables use zlib 1.2.7
2015-08-24 01:35:16 14067 [Note] InnoDB: Using Linux native AIO
2015-08-24 01:35:16 14067 [Note] InnoDB: Not using CPU crc32 instructions
2015-08-24 01:35:16 14067 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-08-24 01:35:16 14067 [Note] InnoDB: Completed initialization of buffer pool
2015-08-24 02:20:53 14239 [Note] Plugin 'FEDERATED' is disabled.
2015-08-24 02:20:53 14239 [ERROR] Function 'innodb' already exists
2015-08-24 02:20:53 14239 [Warning] Couldn't load plugin named 'innodb' with soname 'ha_innodb.so'.
2015-08-24 02:20:53 14239 [ERROR] Function 'federated' already exists
2015-08-24 02:20:53 14239 [Warning] Couldn't load plugin named 'federated' with soname 'ha_federated.so'.
2015-08-24 02:20:53 14239 [ERROR] Function 'blackhole' already exists
2015-08-24 02:20:53 14239 [Warning] Couldn't load plugin named 'blackhole' with soname 'ha_blackhole.so'.
2015-08-24 02:20:53 14239 [ERROR] Function 'archive' already exists
2015-08-24 02:20:53 14239 [Warning] Couldn't load plugin named 'archive' with soname 'ha_archive.so'.
2015-08-24 02:20:53 14239 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-08-24 02:20:53 14239 [Note] InnoDB: The InnoDB memory heap is disabled
2015-08-24 02:20:53 14239 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-08-24 02:20:53 14239 [Note] InnoDB: Memory barrier is not used
2015-08-24 02:20:53 14239 [Note] InnoDB: Compressed tables use zlib 1.2.7
2015-08-24 02:20:53 14239 [Note] InnoDB: Using Linux native AIO
2015-08-24 02:20:53 14239 [Note] InnoDB: Not using CPU crc32 instructions
2015-08-24 02:20:53 14239 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-08-24 02:20:54 14271 [Note] Plugin 'FEDERATED' is disabled.
2015-08-24 02:20:54 14271 [ERROR] Function 'innodb' already exists
2015-08-24 02:20:54 14271 [Warning] Couldn't load plugin named 'innodb' with soname 'ha_innodb.so'.
2015-08-24 02:20:54 14271 [ERROR] Function 'federated' already exists
2015-08-24 02:20:54 14271 [Warning] Couldn't load plugin named 'federated' with soname 'ha_federated.so'.
2015-08-24 02:20:54 14271 [ERROR] Function 'blackhole' already exists
2015-08-24 02:20:54 14271 [Warning] Couldn't load plugin named 'blackhole' with soname 'ha_blackhole.so'.
2015-08-24 02:20:54 14271 [ERROR] Function 'archive' already exists
2015-08-24 02:20:54 14271 [Warning] Couldn't load plugin named 'archive' with soname 'ha_archive.so'.
2015-08-24 02:20:54 14271 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-08-24 02:20:54 14271 [Note] InnoDB: The InnoDB memory heap is disabled
2015-08-24 02:20:54 14271 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-08-24 02:20:54 14271 [Note] InnoDB: Memory barrier is not used
2015-08-24 02:20:54 14271 [Note] InnoDB: Compressed tables use zlib 1.2.7
2015-08-24 02:20:54 14271 [Note] InnoDB: Using Linux native AIO
2015-08-24 02:20:54 14271 [Note] InnoDB: Not using CPU crc32 instructions
2015-08-24 02:20:54 14271 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-08-24 02:20:55 14303 [Note] Plugin 'FEDERATED' is disabled.
2015-08-24 02:20:55 14303 [ERROR] Function 'innodb' already exists
2015-08-24 02:20:55 14303 [Warning] Couldn't load plugin named 'innodb' with soname 'ha_innodb.so'.
2015-08-24 02:20:55 14303 [ERROR] Function 'federated' already exists
2015-08-24 02:20:55 14303 [Warning] Couldn't load plugin named 'federated' with soname 'ha_federated.so'.
2015-08-24 02:20:55 14303 [ERROR] Function 'blackhole' already exists
2015-08-24 02:20:55 14303 [Warning] Couldn't load plugin named 'blackhole' with soname 'ha_blackhole.so'.
2015-08-24 02:20:55 14303 [ERROR] Function 'archive' already exists
2015-08-24 02:20:55 14303 [Warning] Couldn't load plugin named 'archive' with soname 'ha_archive.so'.
2015-08-24 02:20:55 14303 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-08-24 02:20:55 14303 [Note] InnoDB: The InnoDB memory heap is disabled
2015-08-24 02:20:55 14303 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-08-24 02:20:55 14303 [Note] InnoDB: Memory barrier is not used
2015-08-24 02:20:55 14303 [Note] InnoDB: Compressed tables use zlib 1.2.7
2015-08-24 02:20:55 14303 [Note] InnoDB: Using Linux native AIO
2015-08-24 02:20:55 14303 [Note] InnoDB: Not using CPU crc32 instructions
2015-08-24 02:20:55 14303 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-08-24 02:21:04 14340 [Note] Plugin 'FEDERATED' is disabled.
2015-08-24 02:21:04 14340 [ERROR] Function 'innodb' already exists
2015-08-24 02:21:04 14340 [Warning] Couldn't load plugin named 'innodb' with soname 'ha_innodb.so'.
2015-08-24 02:21:04 14340 [ERROR] Function 'federated' already exists
2015-08-24 02:21:04 14340 [Warning] Couldn't load plugin named 'federated' with soname 'ha_federated.so'.
2015-08-24 02:21:04 14340 [ERROR] Function 'blackhole' already exists
2015-08-24 02:21:04 14340 [Warning] Couldn't load plugin named 'blackhole' with soname 'ha_blackhole.so'.
2015-08-24 02:21:04 14340 [ERROR] Function 'archive' already exists
2015-08-24 02:21:04 14340 [Warning] Couldn't load plugin named 'archive' with soname 'ha_archive.so'.
2015-08-24 02:21:04 14340 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-08-24 02:21:04 14340 [Note] InnoDB: The InnoDB memory heap is disabled
2015-08-24 02:21:04 14340 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-08-24 02:21:04 14340 [Note] InnoDB: Memory barrier is not used
2015-08-24 02:21:04 14340 [Note] InnoDB: Compressed tables use zlib 1.2.7
2015-08-24 02:21:04 14340 [Note] InnoDB: Using Linux native AIO
2015-08-24 02:21:04 14340 [Note] InnoDB: Not using CPU crc32 instructions
2015-08-24 02:21:04 14340 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-08-24 02:21:04 14340 [Note] InnoDB: Completed initialization of buffer pool
2015-08-24 02:21:04 14340 [Note] InnoDB: Highest supported file format is Barracuda.
2015-08-24 02:21:04 14340 [Note] InnoDB: The log sequence numbers 54580288 and 54580288 in ibdata files do not match the log sequence number 54580298 in the ib_logfiles!
2015-08-24 02:21:04 14340 [Note] InnoDB: Database was not shutdown normally!
2015-08-24 02:21:04 14340 [Note] InnoDB: Starting crash recovery.
2015-08-24 02:21:04 14340 [Note] InnoDB: Reading tablespace information from the .ibd files...
2015-08-24 02:21:04 14340 [Note] InnoDB: Restoring possible half-written data pages 
2015-08-24 02:21:04 14340 [Note] InnoDB: from the doublewrite buffer...
2015-08-24 02:21:04 14340 [Note] InnoDB: 128 rollback segment(s) are active.
2015-08-24 02:21:04 14340 [Note] InnoDB: Waiting for purge to start
2015-08-24 02:21:04 14340 [Note] InnoDB: 5.6.25 started; log sequence number 54580298
2015-08-24 02:21:04 14340 [Note] Recovering after a crash using /var/log/mysql/mysql-bin
2015-08-24 02:21:04 14340 [Note] Starting crash recovery...
2015-08-24 02:21:04 14340 [Note] Crash recovery finished.
2015-08-24 02:21:04 14340 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3307
2015-08-24 02:21:04 14340 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
2015-08-24 02:21:04 14340 [Note] Server socket created on IP: '127.0.0.1'.
2015-08-24 02:21:04 14340 [Note] Event Scheduler: Loaded 0 events
2015-08-24 02:21:04 14340 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.6.25-1~dotdeb+7.1-log'  socket: '/var/run/mysqld/mysqld.sock'  port: 3307  (Debian)
2015-08-24 02:22:20 14468 [Note] Plugin 'FEDERATED' is disabled.
2015-08-24 02:22:20 14468 [ERROR] Function 'innodb' already exists
2015-08-24 02:22:20 14468 [Warning] Couldn't load plugin named 'innodb' with soname 'ha_innodb.so'.
2015-08-24 02:22:20 14468 [ERROR] Function 'federated' already exists
2015-08-24 02:22:20 14468 [Warning] Couldn't load plugin named 'federated' with soname 'ha_federated.so'.
2015-08-24 02:22:20 14468 [ERROR] Function 'blackhole' already exists
2015-08-24 02:22:20 14468 [Warning] Couldn't load plugin named 'blackhole' with soname 'ha_blackhole.so'.
2015-08-24 02:22:20 14468 [ERROR] Function 'archive' already exists
2015-08-24 02:22:20 14468 [Warning] Couldn't load plugin named 'archive' with soname 'ha_archive.so'.
2015-08-24 02:22:20 14468 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-08-24 02:22:20 14468 [Note] InnoDB: The InnoDB memory heap is disabled
2015-08-24 02:22:20 14468 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-08-24 02:22:20 14468 [Note] InnoDB: Memory barrier is not used
2015-08-24 02:22:20 14468 [Note] InnoDB: Compressed tables use zlib 1.2.7
2015-08-24 02:22:20 14468 [Note] InnoDB: Using Linux native AIO
2015-08-24 02:22:20 14468 [Note] InnoDB: Not using CPU crc32 instructions
2015-08-24 02:22:20 14468 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-08-24 02:22:20 14468 [Note] InnoDB: Completed initialization of buffer pool
2015-08-24 02:22:21 14505 [Note] Plugin 'FEDERATED' is disabled.
2015-08-24 02:22:21 14505 [ERROR] Function 'innodb' already exists
2015-08-24 02:22:21 14505 [Warning] Couldn't load plugin named 'innodb' with soname 'ha_innodb.so'.
2015-08-24 02:22:21 14505 [ERROR] Function 'federated' already exists
2015-08-24 02:22:21 14505 [Warning] Couldn't load plugin named 'federated' with soname 'ha_federated.so'.
2015-08-24 02:22:21 14505 [ERROR] Function 'blackhole' already exists
2015-08-24 02:22:21 14505 [Warning] Couldn't load plugin named 'blackhole' with soname 'ha_blackhole.so'.
2015-08-24 02:22:21 14505 [ERROR] Function 'archive' already exists
2015-08-24 02:22:21 14505 [Warning] Couldn't load plugin named 'archive' with soname 'ha_archive.so'.
2015-08-24 02:22:21 14505 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-08-24 02:22:21 14505 [Note] InnoDB: The InnoDB memory heap is disabled
2015-08-24 02:22:21 14505 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-08-24 02:22:21 14505 [Note] InnoDB: Memory barrier is not used
2015-08-24 02:22:21 14505 [Note] InnoDB: Compressed tables use zlib 1.2.7
2015-08-24 02:22:21 14505 [Note] InnoDB: Using Linux native AIO
2015-08-24 02:22:21 14505 [Note] InnoDB: Not using CPU crc32 instructions
2015-08-24 02:22:21 14505 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-08-24 02:24:56 14546 [Note] Plugin 'FEDERATED' is disabled.
2015-08-24 02:24:56 14546 [ERROR] Function 'innodb' already exists
2015-08-24 02:24:56 14546 [Warning] Couldn't load plugin named 'innodb' with soname 'ha_innodb.so'.
2015-08-24 02:24:56 14546 [ERROR] Function 'federated' already exists
2015-08-24 02:24:56 14546 [Warning] Couldn't load plugin named 'federated' with soname 'ha_federated.so'.
2015-08-24 02:24:56 14546 [ERROR] Function 'blackhole' already exists
2015-08-24 02:24:56 14546 [Warning] Couldn't load plugin named 'blackhole' with soname 'ha_blackhole.so'.
2015-08-24 02:24:56 14546 [ERROR] Function 'archive' already exists
2015-08-24 02:24:56 14546 [Warning] Couldn't load plugin named 'archive' with soname 'ha_archive.so'.
2015-08-24 02:24:56 14546 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-08-24 02:24:56 14546 [Note] InnoDB: The InnoDB memory heap is disabled
2015-08-24 02:24:56 14546 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-08-24 02:24:56 14546 [Note] InnoDB: Memory barrier is not used
2015-08-24 02:24:56 14546 [Note] InnoDB: Compressed tables use zlib 1.2.7
2015-08-24 02:24:56 14546 [Note] InnoDB: Using Linux native AIO
2015-08-24 02:24:56 14546 [Note] InnoDB: Not using CPU crc32 instructions
2015-08-24 02:24:56 14546 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-08-24 02:24:56 14546 [Note] InnoDB: Completed initialization of buffer pool
2015-08-24 02:24:56 14546 [Note] InnoDB: Highest supported file format is Barracuda.
2015-08-24 02:24:56 14546 [Note] InnoDB: The log sequence numbers 54580288 and 54580288 in ibdata files do not match the log sequence number 54580308 in the ib_logfiles!
2015-08-24 02:24:56 14546 [Note] InnoDB: Database was not shutdown normally!
2015-08-24 02:24:56 14546 [Note] InnoDB: Starting crash recovery.
2015-08-24 02:24:56 14546 [Note] InnoDB: Reading tablespace information from the .ibd files...
2015-08-24 02:24:56 14546 [Note] InnoDB: Restoring possible half-written data pages 
2015-08-24 02:24:56 14546 [Note] InnoDB: from the doublewrite buffer...
2015-08-24 02:24:56 14546 [Note] InnoDB: 128 rollback segment(s) are active.
2015-08-24 02:24:56 14546 [Note] InnoDB: Waiting for purge to start
2015-08-24 02:24:56 14546 [Note] InnoDB: 5.6.25 started; log sequence number 54580308
2015-08-24 02:24:56 14546 [Note] Recovering after a crash using /var/log/mysql/mysql-bin
2015-08-24 02:24:56 14546 [Note] Starting crash recovery...
2015-08-24 02:24:56 14546 [Note] Crash recovery finished.
2015-08-24 02:24:56 14546 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3307
2015-08-24 02:24:56 14546 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
2015-08-24 02:24:56 14546 [Note] Server socket created on IP: '127.0.0.1'.
2015-08-24 02:24:56 14546 [Note] Event Scheduler: Loaded 0 events
2015-08-24 02:24:56 14546 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.6.25-1~dotdeb+7.1-log'  socket: '/var/run/mysqld/mysqld.sock'  port: 3307  (Debian)
2015-08-24 02:25:02 14677 [Note] Plugin 'FEDERATED' is disabled.
2015-08-24 02:25:02 14677 [ERROR] Function 'innodb' already exists
2015-08-24 02:25:02 14677 [Warning] Couldn't load plugin named 'innodb' with soname 'ha_innodb.so'.
2015-08-24 02:25:02 14677 [ERROR] Function 'federated' already exists
2015-08-24 02:25:02 14677 [Warning] Couldn't load plugin named 'federated' with soname 'ha_federated.so'.
2015-08-24 02:25:02 14677 [ERROR] Function 'blackhole' already exists
2015-08-24 02:25:02 14677 [Warning] Couldn't load plugin named 'blackhole' with soname 'ha_blackhole.so'.
2015-08-24 02:25:02 14677 [ERROR] Function 'archive' already exists
2015-08-24 02:25:02 14677 [Warning] Couldn't load plugin named 'archive' with soname 'ha_archive.so'.
2015-08-24 02:25:02 14677 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-08-24 02:25:02 14677 [Note] InnoDB: The InnoDB memory heap is disabled
2015-08-24 02:25:02 14677 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-08-24 02:25:02 14677 [Note] InnoDB: Memory barrier is not used
2015-08-24 02:25:02 14677 [Note] InnoDB: Compressed tables use zlib 1.2.7
2015-08-24 02:25:02 14677 [Note] InnoDB: Using Linux native AIO
2015-08-24 02:25:02 14677 [Note] InnoDB: Not using CPU crc32 instructions
2015-08-24 02:25:02 14677 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-08-24 02:25:02 14677 [Note] InnoDB: Completed initialization of buffer pool
2015-08-24 02:25:02 14710 [Note] Plugin 'FEDERATED' is disabled.
2015-08-24 02:25:02 14710 [ERROR] Function 'innodb' already exists
2015-08-24 02:25:02 14710 [Warning] Couldn't load plugin named 'innodb' with soname 'ha_innodb.so'.
2015-08-24 02:25:02 14710 [ERROR] Function 'federated' already exists
2015-08-24 02:25:02 14710 [Warning] Couldn't load plugin named 'federated' with soname 'ha_federated.so'.
2015-08-24 02:25:02 14710 [ERROR] Function 'blackhole' already exists
2015-08-24 02:25:02 14710 [Warning] Couldn't load plugin named 'blackhole' with soname 'ha_blackhole.so'.
2015-08-24 02:25:02 14710 [ERROR] Function 'archive' already exists
2015-08-24 02:25:02 14710 [Warning] Couldn't load plugin named 'archive' with soname 'ha_archive.so'.
2015-08-24 02:25:02 14710 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-08-24 02:25:02 14710 [Note] InnoDB: The InnoDB memory heap is disabled
2015-08-24 02:25:02 14710 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-08-24 02:25:02 14710 [Note] InnoDB: Memory barrier is not used
2015-08-24 02:25:02 14710 [Note] InnoDB: Compressed tables use zlib 1.2.7
2015-08-24 02:25:02 14710 [Note] InnoDB: Using Linux native AIO
2015-08-24 02:25:02 14710 [Note] InnoDB: Not using CPU crc32 instructions
2015-08-24 02:25:02 14710 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-08-24 02:25:02 14710 [Note] InnoDB: Completed initialization of buffer pool
2015-08-24 02:25:19 14767 [Note] Plugin 'FEDERATED' is disabled.
2015-08-24 02:25:19 14767 [ERROR] Function 'innodb' already exists
2015-08-24 02:25:19 14767 [Warning] Couldn't load plugin named 'innodb' with soname 'ha_innodb.so'.
2015-08-24 02:25:19 14767 [ERROR] Function 'federated' already exists
2015-08-24 02:25:19 14767 [Warning] Couldn't load plugin named 'federated' with soname 'ha_federated.so'.
2015-08-24 02:25:19 14767 [ERROR] Function 'blackhole' already exists
2015-08-24 02:25:19 14767 [Warning] Couldn't load plugin named 'blackhole' with soname 'ha_blackhole.so'.
2015-08-24 02:25:19 14767 [ERROR] Function 'archive' already exists
2015-08-24 02:25:19 14767 [Warning] Couldn't load plugin named 'archive' with soname 'ha_archive.so'.
2015-08-24 02:25:19 14767 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-08-24 02:25:19 14767 [Note] InnoDB: The InnoDB memory heap is disabled
2015-08-24 02:25:19 14767 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-08-24 02:25:19 14767 [Note] InnoDB: Memory barrier is not used
2015-08-24 02:25:19 14767 [Note] InnoDB: Compressed tables use zlib 1.2.7
2015-08-24 02:25:19 14767 [Note] InnoDB: Using Linux native AIO
2015-08-24 02:25:19 14767 [Note] InnoDB: Not using CPU crc32 instructions
2015-08-24 02:25:19 14767 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-08-24 02:25:19 14767 [Note] InnoDB: Completed initialization of buffer pool
2015-08-24 02:25:19 14767 [Note] InnoDB: Highest supported file format is Barracuda.
2015-08-24 02:25:19 14767 [Note] InnoDB: The log sequence numbers 54580288 and 54580288 in ibdata files do not match the log sequence number 54580318 in the ib_logfiles!
2015-08-24 02:25:19 14767 [Note] InnoDB: Database was not shutdown normally!
2015-08-24 02:25:19 14767 [Note] InnoDB: Starting crash recovery.
2015-08-24 02:25:19 14767 [Note] InnoDB: Reading tablespace information from the .ibd files...
2015-08-24 02:25:19 14767 [Note] InnoDB: Restoring possible half-written data pages 
2015-08-24 02:25:19 14767 [Note] InnoDB: from the doublewrite buffer...
2015-08-24 02:25:20 14767 [Note] InnoDB: 128 rollback segment(s) are active.
2015-08-24 02:25:20 14767 [Note] InnoDB: Waiting for purge to start
2015-08-24 02:25:20 14767 [Note] InnoDB: 5.6.25 started; log sequence number 54580318
2015-08-24 02:25:20 14767 [Note] Recovering after a crash using /var/log/mysql/mysql-bin
2015-08-24 02:25:20 14767 [Note] Starting crash recovery...
2015-08-24 02:25:20 14767 [Note] Crash recovery finished.
2015-08-24 02:25:20 14767 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3307
2015-08-24 02:25:20 14767 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
2015-08-24 02:25:20 14767 [Note] Server socket created on IP: '127.0.0.1'.
2015-08-24 02:25:20 14767 [Note] Event Scheduler: Loaded 0 events
2015-08-24 02:25:20 14767 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.6.25-1~dotdeb+7.1-log'  socket: '/var/run/mysqld/mysqld.sock'  port: 3307  (Debian)
root@crackkc:/var/log/mysql# 


root@crackkc:/var/log/mysql# cat mysql.log
/usr/sbin/mysqld, Version: 5.6.25-1~dotdeb+7.1-log ((Debian)). started with:
Tcp port: 3307  Unix socket: /var/run/mysqld/mysqld.sock
Time                 Id Command    Argument
150824  3:33:27     1 Connect   debian-sys-maint@localhost on 
                    1 Quit
                    2 Connect   debian-sys-maint@localhost on mysql
                    2 Query     select @@version_comment limit 1
                    2 Query     SET SQL_LOG_BIN=0
                    2 Query     show variables like 'datadir'
                    2 Quit
                    3 Connect   debian-sys-maint@localhost on 
                    3 Query     select @@version_comment limit 1
                    3 Query     SELECT count(*) FROM mysql.user WHERE user='root' and password=''
                    3 Quit
                    4 Connect   debian-sys-maint@localhost on 
                    4 Query     select @@version_comment limit 1
                    4 Query     select concat('select count(*) into @discard from `',
                    TABLE_SCHEMA, '`.`', TABLE_NAME, '`') 
      from information_schema.TABLES where ENGINE='MyISAM'
                    4 Quit
                    5 Connect   debian-sys-maint@localhost on 
                    5 Query     select @@version_comment limit 1
                    5 Query     select count(*) into @discard from `information_schema`.`COLUMNS`
                    5 Quit
                    6 Connect   debian-sys-maint@localhost on 
                    6 Query     select @@version_comment limit 1
                    6 Query     select count(*) into @discard from `information_schema`.`EVENTS`
                    6 Quit
                    7 Connect   debian-sys-maint@localhost on 
                    7 Query     select @@version_comment limit 1
                    7 Query     select count(*) into @discard from `information_schema`.`OPTIMIZER_TRACE`
                    7 Quit
                    8 Connect   debian-sys-maint@localhost on 
                    8 Query     select @@version_comment limit 1
                    8 Query     select count(*) into @discard from `information_schema`.`PARAMETERS`
                    8 Quit
                    9 Connect   debian-sys-maint@localhost on 
                    9 Query     select @@version_comment limit 1
                    9 Query     select count(*) into @discard from `information_schema`.`PARTITIONS`
                    9 Quit
                   10 Connect   debian-sys-maint@localhost on 
                   10 Query     select @@version_comment limit 1
                   10 Query     select count(*) into @discard from `information_schema`.`PLUGINS`
                   10 Quit
                   11 Connect   debian-sys-maint@localhost on 
                   11 Query     select @@version_comment limit 1
                   11 Query     select count(*) into @discard from `information_schema`.`PROCESSLIST`
                   11 Quit
                   12 Connect   debian-sys-maint@localhost on 
                   12 Query     select @@version_comment limit 1
                   12 Query     select count(*) into @discard from `information_schema`.`ROUTINES`
                   12 Quit
                   13 Connect   debian-sys-maint@localhost on 
                   13 Query     select @@version_comment limit 1
                   13 Query     select count(*) into @discard from `information_schema`.`TRIGGERS`
                   13 Quit
                   14 Connect   debian-sys-maint@localhost on 
                   14 Query     select @@version_comment limit 1
                   14 Query     select count(*) into @discard from `information_schema`.`VIEWS`
                   14 Quit
                   15 Connect   debian-sys-maint@localhost on 
                   15 Query     select @@version_comment limit 1
                   15 Query     select count(*) into @discard from `mysql`.`columns_priv`
                   15 Quit
                   16 Connect   debian-sys-maint@localhost on 
                   16 Query     select @@version_comment limit 1
                   16 Query     select count(*) into @discard from `mysql`.`db`
                   16 Quit
                   17 Connect   debian-sys-maint@localhost on 
                   17 Query     select @@version_comment limit 1
                   17 Query     select count(*) into @discard from `mysql`.`event`
                   17 Quit
                   18 Connect   debian-sys-maint@localhost on 
                   18 Query     select @@version_comment limit 1
                   18 Query     select count(*) into @discard from `mysql`.`func`
                   18 Quit
                   19 Connect   debian-sys-maint@localhost on 
                   19 Query     select @@version_comment limit 1
                   19 Query     select count(*) into @discard from `mysql`.`help_category`
                   19 Quit
                   20 Connect   debian-sys-maint@localhost on 
                   20 Query     select @@version_comment limit 1
                   20 Query     select count(*) into @discard from `mysql`.`help_keyword`
                   20 Quit
                   21 Connect   debian-sys-maint@localhost on 
                   21 Query     select @@version_comment limit 1
                   21 Query     select count(*) into @discard from `mysql`.`help_relation`
                   21 Quit
                   22 Connect   debian-sys-maint@localhost on 
                   22 Query     select @@version_comment limit 1
                   22 Query     select count(*) into @discard from `mysql`.`help_topic`
                   22 Quit
                   23 Connect   debian-sys-maint@localhost on 
                   23 Query     select @@version_comment limit 1
                   23 Query     select count(*) into @discard from `mysql`.`ndb_binlog_index`
                   23 Quit
                   24 Connect   debian-sys-maint@localhost on 
                   24 Query     select @@version_comment limit 1
                   24 Query     select count(*) into @discard from `mysql`.`plugin`
                   24 Quit
                   25 Connect   debian-sys-maint@localhost on 
                   25 Query     select @@version_comment limit 1
                   25 Query     select count(*) into @discard from `mysql`.`proc`
                   25 Quit
                   26 Connect   debian-sys-maint@localhost on 
                   26 Query     select @@version_comment limit 1
                   26 Query     select count(*) into @discard from `mysql`.`procs_priv`
                   26 Quit
                   27 Connect   debian-sys-maint@localhost on 
                   27 Query     select @@version_comment limit 1
                   27 Query     select count(*) into @discard from `mysql`.`proxies_priv`
                   27 Quit
                   28 Connect   debian-sys-maint@localhost on 
                   28 Query     select @@version_comment limit 1
                   28 Query     select count(*) into @discard from `mysql`.`servers`
                   28 Quit
                   29 Connect   debian-sys-maint@localhost on 
                   29 Query     select @@version_comment limit 1
                   29 Query     select count(*) into @discard from `mysql`.`tables_priv`
                   29 Quit
                   30 Connect   debian-sys-maint@localhost on 
                   30 Query     select @@version_comment limit 1
                   30 Query     select count(*) into @discard from `mysql`.`time_zone`
                   30 Quit
                   31 Connect   debian-sys-maint@localhost on 
                   31 Query     select @@version_comment limit 1
                   31 Query     select count(*) into @discard from `mysql`.`time_zone_leap_second`
                   31 Quit
                   32 Connect   debian-sys-maint@localhost on 
                   32 Query     select @@version_comment limit 1
                   32 Query     select count(*) into @discard from `mysql`.`time_zone_name`
                   32 Quit
                   33 Connect   debian-sys-maint@localhost on 
                   33 Query     select @@version_comment limit 1
                   33 Query     select count(*) into @discard from `mysql`.`time_zone_transition`
                   33 Quit
                   34 Connect   debian-sys-maint@localhost on 
                   34 Query     select @@version_comment limit 1
                   34 Query     select count(*) into @discard from `mysql`.`time_zone_transition_type`
                   34 Quit
                   35 Connect   debian-sys-maint@localhost on 
                   35 Query     select @@version_comment limit 1
                   35 Query     select count(*) into @discard from `mysql`.`user`
                   35 Quit
                   36 Connect   debian-sys-maint@localhost on 
                   36 Query     select @@version_comment limit 1
                   36 Query     select count(*) into @discard from `niws`.`catalog`
                   36 Quit
                   37 Connect   debian-sys-maint@localhost on 
                   37 Query     select @@version_comment limit 1
                   37 Query     select count(*) into @discard from `niws`.`comments`
                   37 Quit
                   38 Connect   debian-sys-maint@localhost on 
                   38 Query     select @@version_comment limit 1
                   38 Query     select count(*) into @discard from `niws`.`content`
                   38 Quit
                   39 Connect   debian-sys-maint@localhost on 
                   39 Query     select @@version_comment limit 1
                   39 Query     select count(*) into @discard from `niws`.`forum`
                   39 Quit
                   40 Connect   debian-sys-maint@localhost on 
                   40 Query     select @@version_comment limit 1
                   40 Query     select count(*) into @discard from `niws`.`mail`
                   40 Quit
                   41 Connect   debian-sys-maint@localhost on 
                   41 Query     select @@version_comment limit 1
                   41 Query     select count(*) into @discard from `niws`.`menu`
                   41 Quit
                   42 Connect   debian-sys-maint@localhost on 
                   42 Query     select @@version_comment limit 1
                   42 Query     select count(*) into @discard from `niws`.`news`
                   42 Quit
                   43 Connect   debian-sys-maint@localhost on 
                   43 Query     select @@version_comment limit 1
                   43 Query     select count(*) into @discard from `niws`.`pages`
                   43 Quit
                   44 Connect   debian-sys-maint@localhost on 
                   44 Query     select @@version_comment limit 1
                   44 Query     select count(*) into @discard from `niws`.`user_admin`
                   44 Quit
                   45 Connect   debian-sys-maint@localhost on 
                   45 Query     select @@version_comment limit 1
                   45 Query     select count(*) into @discard from `phpmyadmin`.`pma_bookmark`
                   45 Quit
                   46 Connect   debian-sys-maint@localhost on 
                   46 Query     select @@version_comment limit 1
                   46 Query     select count(*) into @discard from `phpmyadmin`.`pma_column_info`
                   46 Quit
                   47 Connect   debian-sys-maint@localhost on 
                   47 Query     select @@version_comment limit 1
                   47 Query     select count(*) into @discard from `phpmyadmin`.`pma_designer_coords`
                   47 Quit
                   48 Connect   debian-sys-maint@localhost on 
                   48 Query     select @@version_comment limit 1
                   48 Query     select count(*) into @discard from `phpmyadmin`.`pma_history`
                   48 Quit
                   49 Connect   debian-sys-maint@localhost on 
                   49 Query     select @@version_comment limit 1
                   49 Query     select count(*) into @discard from `phpmyadmin`.`pma_pdf_pages`
                   49 Quit
                   50 Connect   debian-sys-maint@localhost on 
                   50 Query     select @@version_comment limit 1
                   50 Query     select count(*) into @discard from `phpmyadmin`.`pma_relation`
                   50 Quit
                   51 Connect   debian-sys-maint@localhost on 
                   51 Query     select @@version_comment limit 1
                   51 Query     select count(*) into @discard from `phpmyadmin`.`pma_table_coords`
                   51 Quit
                   52 Connect   debian-sys-maint@localhost on 
                   52 Query     select @@version_comment limit 1
                   52 Query     select count(*) into @discard from `phpmyadmin`.`pma_table_info`
                   52 Quit
                   53 Connect   debian-sys-maint@localhost on 
                   53 Query     select @@version_comment limit 1
                   53 Query     select count(*) into @discard from `phpmyadmin`.`pma_tracking`
                   53 Quit
                   54 Connect   debian-sys-maint@localhost on 
                   54 Query     select @@version_comment limit 1
                   54 Query     select count(*) into @discard from `phpmyadmin`.`pma_userconfig`
                   54 Quit
150824  3:33:29    55 Connect   root@localhost on 
                   55 Init DB   niws
                   55 Query     SET NAMES utf8
                   55 Query     SELECT *
FROM (`menu`)
WHERE `id` =  '88'
                   55 Query     SELECT *
FROM (`menu`)
WHERE `id_mom` =  '22'
ORDER BY `order` ASC
                   55 Query     SELECT *
FROM (`menu`)
WHERE `id` =  '88'
                   55 Query     SELECT *
FROM (`menu`)
ORDER BY `order` ASC
                   55 Query     SELECT *
FROM (`catalog`)
WHERE `cat` =  '88'
ORDER BY `id` DESC
                   55 Query     SELECT *
FROM (`menu`)
WHERE `url` =  '1'
ORDER BY `order` ASC
                   56 Connect   root@localhost on 
                   56 Init DB   niws
                   56 Query     SET NAMES utf8
                   56 Query     SELECT *
FROM (`pages`)
WHERE `name` =  'main'
                   56 Query     SELECT *
FROM (`menu`)
ORDER BY `order` ASC
                   56 Query     SELECT *
FROM (`menu`)
WHERE `id_mom` =  '22'
ORDER BY `order` ASC
                   56 Query     SELECT *
FROM (`content`)
WHERE `cat` =  'main'
                   56 Query     SELECT *
FROM (`catalog`)
WHERE `tip_text` =  'history'
ORDER BY `id` DESC
LIMIT 2
                   56 Query     SELECT *
FROM (`catalog`)
WHERE `tip_text` =  'open'
ORDER BY `id` DESC
LIMIT 2
                   56 Query     SELECT *
FROM (`catalog`)
WHERE `tip_text` =  'ludi'
ORDER BY `id` DESC
LIMIT 2
/usr/sbin/mysqld, Version: 5.6.25-1~dotdeb+7.1-log ((Debian)). started with:
Tcp port: 3307  Unix socket: /var/run/mysqld/mysqld.sock
Time                 Id Command    Argument
150824  3:33:59     1 Connect   debian-sys-maint@localhost on 
                    1 Quit
                    2 Connect   debian-sys-maint@localhost on mysql
                    2 Query     select @@version_comment limit 1
                    2 Query     SET SQL_LOG_BIN=0
                    2 Query     show variables like 'datadir'
                    2 Quit
                    3 Connect   debian-sys-maint@localhost on 
                    3 Query     select @@version_comment limit 1
                    3 Query     SELECT count(*) FROM mysql.user WHERE user='root' and password=''
                    3 Quit
                    4 Connect   debian-sys-maint@localhost on 
                    4 Query     select @@version_comment limit 1
                    4 Query     select concat('select count(*) into @discard from `',
                    TABLE_SCHEMA, '`.`', TABLE_NAME, '`') 
      from information_schema.TABLES where ENGINE='MyISAM'
                    4 Quit
                    5 Connect   debian-sys-maint@localhost on 
                    5 Query     select @@version_comment limit 1
                    5 Query     select count(*) into @discard from `information_schema`.`COLUMNS`
                    5 Quit
                    6 Connect   debian-sys-maint@localhost on 
                    6 Query     select @@version_comment limit 1
                    6 Query     select count(*) into @discard from `information_schema`.`EVENTS`
                    6 Quit
                    7 Connect   debian-sys-maint@localhost on 
                    7 Query     select @@version_comment limit 1
                    7 Query     select count(*) into @discard from `information_schema`.`OPTIMIZER_TRACE`
                    7 Quit
                    8 Connect   debian-sys-maint@localhost on 
                    8 Query     select @@version_comment limit 1
                    8 Query     select count(*) into @discard from `information_schema`.`PARAMETERS`
                    8 Quit
                    9 Connect   debian-sys-maint@localhost on 
                    9 Query     select @@version_comment limit 1
                    9 Query     select count(*) into @discard from `information_schema`.`PARTITIONS`
                    9 Quit
                   10 Connect   debian-sys-maint@localhost on 
                   10 Query     select @@version_comment limit 1
                   10 Query     select count(*) into @discard from `information_schema`.`PLUGINS`
                   10 Quit
                   11 Connect   debian-sys-maint@localhost on 
                   11 Query     select @@version_comment limit 1
                   11 Query     select count(*) into @discard from `information_schema`.`PROCESSLIST`
                   11 Quit
                   12 Connect   debian-sys-maint@localhost on 
                   12 Query     select @@version_comment limit 1
                   12 Query     select count(*) into @discard from `information_schema`.`ROUTINES`
                   12 Quit
                   13 Connect   debian-sys-maint@localhost on 
                   13 Query     select @@version_comment limit 1
                   13 Query     select count(*) into @discard from `information_schema`.`TRIGGERS`
                   13 Quit
                   14 Connect   debian-sys-maint@localhost on 
                   14 Query     select @@version_comment limit 1
                   14 Query     select count(*) into @discard from `information_schema`.`VIEWS`
                   14 Quit
                   15 Connect   debian-sys-maint@localhost on 
                   15 Query     select @@version_comment limit 1
                   15 Query     select count(*) into @discard from `mysql`.`columns_priv`
                   15 Quit
                   16 Connect   debian-sys-maint@localhost on 
                   16 Query     select @@version_comment limit 1
                   16 Query     select count(*) into @discard from `mysql`.`db`
                   16 Quit
                   17 Connect   debian-sys-maint@localhost on 
                   17 Query     select @@version_comment limit 1
                   17 Query     select count(*) into @discard from `mysql`.`event`
                   17 Quit
                   18 Connect   debian-sys-maint@localhost on 
                   18 Query     select @@version_comment limit 1
                   18 Query     select count(*) into @discard from `mysql`.`func`
                   18 Quit
                   19 Connect   debian-sys-maint@localhost on 
                   19 Query     select @@version_comment limit 1
                   19 Query     select count(*) into @discard from `mysql`.`help_category`
                   19 Quit
                   20 Connect   debian-sys-maint@localhost on 
                   20 Query     select @@version_comment limit 1
                   20 Query     select count(*) into @discard from `mysql`.`help_keyword`
                   20 Quit
                   21 Connect   debian-sys-maint@localhost on 
                   21 Query     select @@version_comment limit 1
                   21 Query     select count(*) into @discard from `mysql`.`help_relation`
                   21 Quit
                   22 Connect   debian-sys-maint@localhost on 
                   22 Query     select @@version_comment limit 1
                   22 Query     select count(*) into @discard from `mysql`.`help_topic`
                   22 Quit
                   23 Connect   debian-sys-maint@localhost on 
                   23 Query     select @@version_comment limit 1
                   23 Query     select count(*) into @discard from `mysql`.`ndb_binlog_index`
                   23 Quit
150824  3:34:00    24 Connect   debian-sys-maint@localhost on 
                   24 Query     select @@version_comment limit 1
                   24 Query     select count(*) into @discard from `mysql`.`plugin`
                   24 Quit
                   25 Connect   debian-sys-maint@localhost on 
                   25 Query     select @@version_comment limit 1
                   25 Query     select count(*) into @discard from `mysql`.`proc`
                   25 Quit
                   26 Connect   debian-sys-maint@localhost on 
                   26 Query     select @@version_comment limit 1
                   26 Query     select count(*) into @discard from `mysql`.`procs_priv`
                   26 Quit
                   27 Connect   debian-sys-maint@localhost on 
                   27 Query     select @@version_comment limit 1
                   27 Query     select count(*) into @discard from `mysql`.`proxies_priv`
                   27 Quit
                   28 Connect   debian-sys-maint@localhost on 
                   28 Query     select @@version_comment limit 1
                   28 Query     select count(*) into @discard from `mysql`.`servers`
                   28 Quit
                   29 Connect   debian-sys-maint@localhost on 
                   29 Query     select @@version_comment limit 1
                   29 Query     select count(*) into @discard from `mysql`.`tables_priv`
                   29 Quit
                   30 Connect   debian-sys-maint@localhost on 
                   30 Query     select @@version_comment limit 1
                   30 Query     select count(*) into @discard from `mysql`.`time_zone`
                   30 Quit
                   31 Connect   debian-sys-maint@localhost on 
                   31 Query     select @@version_comment limit 1
                   31 Query     select count(*) into @discard from `mysql`.`time_zone_leap_second`
                   31 Quit
                   32 Connect   debian-sys-maint@localhost on 
                   32 Query     select @@version_comment limit 1
                   32 Query     select count(*) into @discard from `mysql`.`time_zone_name`
                   32 Quit
                   33 Connect   debian-sys-maint@localhost on 
                   33 Query     select @@version_comment limit 1
                   33 Query     select count(*) into @discard from `mysql`.`time_zone_transition`
                   33 Quit
                   34 Connect   debian-sys-maint@localhost on 
                   34 Query     select @@version_comment limit 1
                   34 Query     select count(*) into @discard from `mysql`.`time_zone_transition_type`
                   34 Quit
                   35 Connect   debian-sys-maint@localhost on 
                   35 Query     select @@version_comment limit 1
                   35 Query     select count(*) into @discard from `mysql`.`user`
                   35 Quit
                   36 Connect   debian-sys-maint@localhost on 
                   36 Query     select @@version_comment limit 1
                   36 Query     select count(*) into @discard from `niws`.`catalog`
                   36 Quit
                   37 Connect   debian-sys-maint@localhost on 
                   37 Query     select @@version_comment limit 1
                   37 Query     select count(*) into @discard from `niws`.`comments`
                   37 Quit
                   38 Connect   debian-sys-maint@localhost on 
                   38 Query     select @@version_comment limit 1
                   38 Query     select count(*) into @discard from `niws`.`content`
                   38 Quit
                   39 Connect   debian-sys-maint@localhost on 
                   39 Query     select @@version_comment limit 1
                   39 Query     select count(*) into @discard from `niws`.`forum`
                   39 Quit
                   40 Connect   debian-sys-maint@localhost on 
                   40 Query     select @@version_comment limit 1
                   40 Query     select count(*) into @discard from `niws`.`mail`
                   40 Quit
                   41 Connect   debian-sys-maint@localhost on 
                   41 Query     select @@version_comment limit 1
                   41 Query     select count(*) into @discard from `niws`.`menu`
                   41 Quit
                   42 Connect   debian-sys-maint@localhost on 
                   42 Query     select @@version_comment limit 1
                   42 Query     select count(*) into @discard from `niws`.`news`
                   42 Quit
                   43 Connect   debian-sys-maint@localhost on 
                   43 Query     select @@version_comment limit 1
                   43 Query     select count(*) into @discard from `niws`.`pages`
                   43 Quit
                   44 Connect   debian-sys-maint@localhost on 
                   44 Query     select @@version_comment limit 1
                   44 Query     select count(*) into @discard from `niws`.`user_admin`
                   44 Quit
                   45 Connect   debian-sys-maint@localhost on 
                   45 Query     select @@version_comment limit 1
                   45 Query     select count(*) into @discard from `phpmyadmin`.`pma_bookmark`
                   45 Quit
                   46 Connect   debian-sys-maint@localhost on 
                   46 Query     select @@version_comment limit 1
                   46 Query     select count(*) into @discard from `phpmyadmin`.`pma_column_info`
                   46 Quit
                   47 Connect   debian-sys-maint@localhost on 
                   47 Query     select @@version_comment limit 1
                   47 Query     select count(*) into @discard from `phpmyadmin`.`pma_designer_coords`
                   47 Quit
                   48 Connect   debian-sys-maint@localhost on 
                   48 Query     select @@version_comment limit 1
                   48 Query     select count(*) into @discard from `phpmyadmin`.`pma_history`
                   48 Quit
                   49 Connect   debian-sys-maint@localhost on 
                   49 Query     select @@version_comment limit 1
                   49 Query     select count(*) into @discard from `phpmyadmin`.`pma_pdf_pages`
                   49 Quit
                   50 Connect   debian-sys-maint@localhost on 
                   50 Query     select @@version_comment limit 1
                   50 Query     select count(*) into @discard from `phpmyadmin`.`pma_relation`
                   50 Quit
                   51 Connect   debian-sys-maint@localhost on 
                   51 Query     select @@version_comment limit 1
                   51 Query     select count(*) into @discard from `phpmyadmin`.`pma_table_coords`
                   51 Quit
                   52 Connect   debian-sys-maint@localhost on 
                   52 Query     select @@version_comment limit 1
                   52 Query     select count(*) into @discard from `phpmyadmin`.`pma_table_info`
                   52 Quit
                   53 Connect   debian-sys-maint@localhost on 
                   53 Query     select @@version_comment limit 1
                   53 Query     select count(*) into @discard from `phpmyadmin`.`pma_tracking`
                   53 Quit
                   54 Connect   debian-sys-maint@localhost on 
                   54 Query     select @@version_comment limit 1
                   54 Query     select count(*) into @discard from `phpmyadmin`.`pma_userconfig`
                   54 Quit
150824  3:34:02    55 Connect   root@localhost on 
                   55 Init DB   niws
                   55 Query     SET NAMES utf8
                   55 Query     SELECT *
FROM (`menu`)
WHERE `id` =  '85'
                   55 Query     SELECT *
FROM (`menu`)
WHERE `id_mom` =  '22'
ORDER BY `order` ASC
                   55 Query     SELECT *
FROM (`menu`)
WHERE `id` =  '85'
                   55 Query     SELECT *
FROM (`menu`)
ORDER BY `order` ASC
                   55 Query     SELECT *
FROM (`catalog`)
WHERE `cat` =  '85'
ORDER BY `id` DESC
                   55 Query     SELECT *
FROM (`menu`)
WHERE `url` =  '1'
ORDER BY `order` ASC
                   56 Connect   root@localhost on 
                   56 Init DB   niws
                   56 Query     SET NAMES utf8
                   56 Query     SELECT *
FROM (`pages`)
WHERE `name` =  'main'
                   56 Query     SELECT *
FROM (`menu`)
ORDER BY `order` ASC
                   56 Query     SELECT *
FROM (`menu`)
WHERE `id_mom` =  '22'
ORDER BY `order` ASC
                   56 Query     SELECT *
FROM (`content`)
WHERE `cat` =  'main'
                   56 Query     SELECT *
FROM (`catalog`)
WHERE `tip_text` =  'history'
ORDER BY `id` DESC
LIMIT 2
                   56 Query     SELECT *
FROM (`catalog`)
WHERE `tip_text` =  'open'
ORDER BY `id` DESC
LIMIT 2
                   56 Query     SELECT *
FROM (`catalog`)
WHERE `tip_text` =  'ludi'
ORDER BY `id` DESC
LIMIT 2
root@crackkc:/var/log/mysql# 
Ответ: !includedir /etc/mysql/conf.d/

вот тут
Вопрос: Оптимизация MySQL по результатам mysqltuner.pl

Добрый день всем, честно говоря я не профи в настройке mysql но после переноса части сайтов мускул стал грузить процессор под 300-500 процентов что и заставило меня полезть в более глубокую настройку.

Временные файлы вынес уже в ОЗУ, таблицы чекал раза четыре и разными способами но количество фрагментированных таблиц остается в пределах 300-500 таблиц, как ни крути. Не знаю почему, но вопрос в другом. Следую плавно советам mysqltuner и подкручиваю значения, паралелльно читая что за что отвечает и где какие должны быть оптимальные значения но уже начинаю волноватся за некоторые параметры которые кажутся "большими" скромно говоря. Можете проверить и подсказать что где не так или на что стоит обратить внимание, буду очень признателен.

вот содержимое файла my.cnf

#
# 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
default-character-set = utf8

# 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		= /dev/shm
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.
#
# * Fine Tuning
#
key_buffer		= 3048M
max_allowed_packet	= 16M
thread_stack		= 192K
thread_cache_size       = 32
join_buffer_size	= 256K
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover         = BACKUP
max_connections        = 300
table_cache            = 8096
open_files_limit	= 16192
#interactive_timeout	= 28800
#wait_timeout		= 28800
#thread_concurrency     = 10
#
# * Query Cache Configuration
#
query_cache_limit	= 18M
query_cache_size        = 896M
table_open_cache	= 8000
#
# * 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
default-character-set = utf8
#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


tmp_table_size = 512M
max_heap_table_size = 256M
table_cache = 4048
innodb_buffer_pool_size = 2048M



[mysqldump]
quick
quote-names
max_allowed_packet	= 16M
default-character-set = utf8

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

default-character-set = utf8
[isamchk]
key_buffer		= 2048M

#
# * 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/


вот что выдает myslqtuner

-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.1.63-0+squeeze1-log
[OK] Operating on 64-bit architecture

-------- Storage Engine Statistics -------------------------------------------
[--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 11G (Tables: 3504)
[--] Data in InnoDB tables: 1G (Tables: 292)
[--] Data in MEMORY tables: 0B (Tables: 4)
[!!] Total fragmented tables: 461

-------- Security Recommendations  -------------------------------------------
[OK] All database users have passwords assigned

-------- Performance Metrics -------------------------------------------------
[--] Up for: 29m 5s (523K q [300.139 qps], 18K conn, TX: 2B, RX: 63M)
[--] Reads / Writes: 94% / 6%
[--] Total buffers: 6.1G global + 2.8M per thread (300 max threads)
[OK] Maximum possible memory usage: 6.9G (22% of installed RAM)
[OK] Slow queries: 1% (10K/523K)
[OK] Highest usage of available connections: 21% (65/300)
[OK] Key buffer size / total MyISAM indexes: 3.0G/1.5G
[OK] Key buffer hit rate: 100.0% (966M cached / 219K reads)
[OK] Query cache efficiency: 64.7% (284K cached / 439K selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (260 temp sorts / 54K sorts)
[!!] Joins performed without indexes: 1227
[!!] Temporary tables created on disk: 42% (12K on disk / 28K total)
[OK] Thread cache hit rate: 99% (65 created / 18K connections)
[OK] Table cache hit rate: 26% (4K open / 15K opened)
[OK] Open file limit used: 44% (7K/16K)
[OK] Table locks acquired immediately: 99% (191K immediate / 191K locks)
[OK] InnoDB data size / buffer pool: 1.5G/2.0G

-------- Recommendations -----------------------------------------------------
General recommendations:
    Run OPTIMIZE TABLE to defragment tables for better performance
    MySQL started within last 24 hours - recommendations may be inaccurate
    Adjust your join queries to always utilize indexes
    Temporary table size is already large - reduce result set size
    Reduce your SELECT DISTINCT queries without LIMIT clauses
Variables to adjust:
    join_buffer_size (> 256.0K, or always use indexes with joins)


вот что творится в топе

top - 00:48:28 up 237 days,  7:29,  1 user,  load average: 5.15, 6.64, 7.16
Tasks: 307 total,   5 running, 302 sleeping,   0 stopped,   0 zombie
Cpu(s): 75.1%us, 14.2%sy,  0.0%ni,  9.8%id,  0.7%wa,  0.0%hi,  0.1%si,  0.0%st
Mem:  32703444k total, 31550156k used,  1153288k free,  2300076k buffers
Swap: 33553332k total,     8296k used, 33545036k free, 21243024k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
15750 mysql     20   0 6620m 2.6g 7896 S  345  8.4  70:06.29 mysqld
23246 www-data  20   0  344m 127m 7276 R   73  0.4   0:35.28 apache2
24004 www-data  20   0  290m  77m 5928 S   44  0.2   0:06.39 apache2
23957 www-data  20   0  292m  77m 5976 R   41  0.2   0:19.32 apache2
24025 www-data  20   0  272m  60m 4292 S   30  0.2   0:00.90 apache2
23913 www-data  20   0  295m  83m 6716 R   29  0.3   0:37.49 apache2
23912 www-data  20   0  277m  65m 6768 S   25  0.2   0:47.11 apache2
24003 www-data  20   0  273m  60m 6232 S   24  0.2   0:16.04 apache2
23292 www-data  20   0  290m  78m 7556 S   21  0.2   1:06.56 apache2
23935 www-data  20   0  284m  69m 6780 S   19  0.2   0:32.12 apache2
23922 www-data  20   0  291m  78m 6120 R   16  0.2   1:02.37 apache2
23920 www-data  20   0  278m  65m 6872 S   15  0.2   0:21.00 apache2
23958 www-data  20   0  279m  67m 6920 S   11  0.2   0:18.90 apache2
24023 www-data  20   0  268m  57m 4784 S   10  0.2   0:01.65 apache2
23286 www-data  20   0  281m  67m 6816 S    9  0.2   0:07.07 apache2
23291 www-data  20   0  288m  74m 7092 S    1  0.2   0:33.66 apache2
 9591 root      20   0     0    0    0 S    0  0.0   1:51.62 kworker/4:1
18429 root      20   0     0    0    0 S    0  0.0   0:37.95 kworker/1:1
23311 www-data  20   0  277m  66m 6568 S    0  0.2   0:03.41 apache2
24024 root      20   0 19256 1456  948 R    0  0.0   0:00.02 top
26329 gitlab    20   0  943m 133m 2168 S    0  0.4 167:56.34 ruby1.9.1
28214 www-data  20   0 56732  28m 1788 S    0  0.1   1:08.11 nginx
    1 root      20   0  8404  716  592 S    0  0.0   2:09.28 init
    2 root      20   0     0    0    0 S    0  0.0   0:00.22 kthreadd
    3 root      20   0     0    0    0 S    0  0.0   9:10.40 ksoftirqd/0
    6 root      RT   0     0    0    0 S    0  0.0   0:26.19 migration/0
    7 root      RT   0     0    0    0 S    0  0.0   0:47.69 watchdog/0
    8 root      RT   0     0    0    0 S    0  0.0   0:32.35 migration/1
   10 root      20   0     0    0    0 S    0  0.0   5:38.45 ksoftirqd/1
   12 root      RT   0     0    0    0 S    0  0.0   0:31.18 watchdog/1
   13 root      RT   0     0    0    0 S    0  0.0   0:23.97 migration/2
   15 root      20   0     0    0    0 S    0  0.0   5:21.56 ksoftirqd/2
   16 root      RT   0     0    0    0 S    0  0.0   0:23.93 watchdog/2
   17 root      RT   0     0    0    0 S    0  0.0   0:18.57 migration/3
   19 root      20   0     0    0    0 S    0  0.0   5:15.37 ksoftirqd/3


в целом в данный момент показатели вроде в норме но иногда без видимой причины резко растет la и вырастает до 20, иногда до 50 и mysqltuner выдает совет увеличить

query_cache_limit = 18M
query_cache_size = 896M

которые на мой взгляд уже нереально большие обосновывая это большим количеством

Query cache prunes per day

Баз на сервере очень много, 32гб памяти, поэтому все так сложно. Подскажите, буду очень признателен за любые советы и мнения.
Ответ: ну вот, при кеше в 128мб уже через 15 минут полезли prunes

-------- Performance Metrics -------------------------------------------------
[--] Up for: 14m 53s (328K q [368.365 qps], 12K conn, TX: 1B, RX: 43M)
[--] Reads / Writes: 93% / 7%
[--] Total buffers: 4.4G global + 6.6M per thread (300 max threads)
[OK] Maximum possible memory usage: 6.3G (20% of installed RAM)
[OK] Slow queries: 2% (8K/328K)
[OK] Highest usage of available connections: 16% (49/300)
[OK] Key buffer size / total MyISAM indexes: 2.0G/1.5G
[OK] Key buffer hit rate: 100.0% (545M cached / 178K reads)
[OK] Query cache efficiency: 63.3% (176K cached / 278K selects)
[!!] Query cache prunes per day: 1996875
[OK] Sorts requiring temporary tables: 0% (141 temp sorts / 35K sorts)
[!!] Joins performed without indexes: 1069
[!!] Temporary tables created on disk: 41% (7K on disk / 18K total)
[OK] Thread cache hit rate: 99% (49 created / 12K connections)
[OK] Table cache hit rate: 25% (4K open / 15K opened)
[OK] Open file limit used: 44% (7K/16K)
[OK] Table locks acquired immediately: 99% (128K immediate / 128K locks)
[OK] InnoDB data size / buffer pool: 1.5G/2.0G

-------- Recommendations -----------------------------------------------------
General recommendations:
    Run OPTIMIZE TABLE to defragment tables for better performance
    MySQL started within last 24 hours - recommendations may be inaccurate
    Adjust your join queries to always utilize indexes
    Temporary table size is already large - reduce result set size
    Reduce your SELECT DISTINCT queries without LIMIT clauses
Variables to adjust:
    query_cache_size (> 128M)
    join_buffer_size (> 4.0M, or always use indexes with joins)


Сейчас поставлю 256 но уверен что и этого будет мало и будет просить дальше, до примерно отметки в 1гб (1гб долго не гонял, возможно и там будет лезть)
Вопрос: Постраничный вывод и limit

Добрый день.
Переделываю программу, которая обращается к базе данных. Данные выгружаются довольно долго, поэтому решил их разбить по страницам, но натолкнулся в интернете на информацию, что mysql все равно просматривает все записи, вне зависимости от ограничения.
Запрос

Код MySQL
1
SELECT id,pcname,domain,inv,ip,mac,curdatetime  FROM ChangePc  order by ip Limit 0, 25

выполняется в консоли около 3 с, а в программе секунд по 15-20, чего очень бы хотелось избежать.

Нашел совет сделать через объединение таблиц:

Код MySQL
1
select ChangePc.id,pcname,domain,inv,ip,mac,curdatetime  from ChangePc JOIN (SELECT id FROM ChangePc ORDER BY id ) as b ON b.id = ChangePc.id LIMIT 0, 25;

Но и это не дает желаемого результата.

С БД только начинаю работать, поэтому, к сожалению, пока с оптимизацией печально
Ответ: LIMIT спасает только от передачи больших объемов данных, скорость выбора никак не уменьшает. LIMIT - постоператор, что означает, что выборка в любом случае производится полная, а после обрезается определенный интервал.
Вопрос: LIMIT в IN

Нужна помощ!
Тут ошибка, как я поняла, в том, что нельзя использовать LIMIT в IN. Как ее обойти?

MySQL
1
SELECT * FROM `product` WHERE `PR_id` IN (SELECT `PR_id` FROM `product` WHERE `app`='Y'  ORDER BY `PR_id` DESC LIMIT 0, 30 ) ORDER BY `product`.`PR_id` DESC LIMIT 0, 12
Ответ: Lazy_Den, будет работать если `PR_id` уникальный

khrustal, ваш запрос можно переписать как
MySQL
1
SELECT * FROM `product` WHERE `app`='Y'  ORDER BY `PR_id` DESC LIMIT 0, 12
Вопрос: Правильное использование Limit

Привет, хочу использовать Limit в пагинации страниц, и вот собственно вопрос, можно ли использовать
Код MySQL
1
$query = 'SELECT * FROM guestbook LIMIT 0,5';
но вместо 0,5 использовать какие то переменные? ну что то типо "$query = 'SELECT * FROM guestbook LIMIT $start,$leng'".. Если нельзя то может есть какие то аналоги этой функции, но с такими возможностями.
Скажу стразу mysql только начинаю изучать, так что особо не пинайтесь
Ответ: О спасибо Вам большое, помогло!)
Код PHP
1
2
3
$start=0;
$leng=5;
if($check == 'prev'){$query = 'SELECT * FROM guestbook LIMIT ' . $start . ',' . $leng;}
Вопрос: Трудности при использовании LIMIT

Доброй ночи, уважаемые форумчане!
Проблема вот в чем. Для начала немного о ситуации. Например, есть галерея картинок и нужно, чтобы картинка могла находиться одновременно в нескольких категориях. Реализовано это примерно так (примерно в том смысле, что эта структура таблиц не та, которая у меня используется, а так, чтобы не усложнять пример ненужными подробностями). Есть таблица с файлами (например, `files`):

ID | filename
1 | 1.jpg
2 | 2.jpg


Есть таблица с категориями (например, `categories`):

ID | name
1 | Авто
2 | Мото
3 | Разное


И таблица, которая связывает файлы с категориями (например, `catfiles`):

ID | fileID | catID
1 | 1 | 1
2 | 1 | 3
3 | 2 | 3


По содержимому таблицы `catfiles` получается, что картинка 1.jpg находится в категориях Авто и Разное, а картинка 2.jpg только в категории Разное. При примерно таком запросе
SQL
1
2
3
4
5
SELECT `files`.*,
`categories`.`name`
FROM `files`, `categories`,`catfiles`
WHERE `categories`.`ID`=`catfiles`.`catID`
    AND `catfiles`.`fileID`=`files`.`ID`
(запрос тоже примерный - я не проверял его на работоспособность)
должно приходить три строки - две для файла 1.jpg (потому что у него разница в имени категории) и одна для файла 2.jpg. На PHP я убираю повторяющиеся строки группировкой категорий в массив и всё норм. Проблема только в том, что если использовать LIMIT, то он будет ограничивать выборку не совсем так, как мне нужно! Если в этом примере использовать LIMIT 0, 2 придет только две строки и получится, что для файла 1.jpg будет только одна категория (либо 1.jpg будет в двух категориях, а второго файла не будет - точно не знаю)! Как быть в таком случае? Как хранить, например тот же файл в нескольких категориях (в неограниченном их количестве)?
Шарился в Google, но мне находило только кучу всякой ерунды, не относящейся к моей проблеме :-(
Ответ: Не стал заморачиваться и сделал в два запроса - сначала с LIMIT'ом извлекаются необходимые записи, а потом вторым запросом извлекаются данные категорий, к которым эти записи относятся...
P.S. Благодарю за внимание!
Вопрос: оптимизация MySQL

Добрый день.
В обслуживание достался офисный ПК:
- процессор AMD Athlon II X4 640 (4 ядра по 3 ГГц),
- оперативная память 4 ГБ PC3-10600 DDR-3,
- видео встроенное,
- жесткий диск Seagate ST500DM002 500 ГБ 7200rpm,
- операционка XP SP3 32-bit
- СУБД MySQL 4.1 и БД размером 3,6 ГБ.
К базе данных в час пик поступает порядка 70 запросов на запись в минуту, но не более 5000 запросов на запись в сутки. Количество запросов на чтение мне неизвестно.
Софт, работающий с БД, подтормаживает. Удаление старых записей и дефрагментация БД (dbForge Studio for MySQL) временно улучшают ситуацию, но тормоза всё равно остаются. Связь с разработчиками софта отсутствует. Единственное, что могу сказать: по-видимому, при запуске софт считывает всю БД, поскольку загружается весьма долго.
Компьютер работает круглосуточно, не перезагружается. Никаких оптимизаторов и очистителей оперативной памяти не используется.
ВОПРОС: Какие общие рекомендации по настройке операционной системы и СУБД Вы можете дать, чтобы подоживить систему?
С уважением, Сергей.
Ответ: Наконец руки дошли включить логирование:
1. При запуске софта медленных запросов не выявлено, в общий лог пошли запросы проверки таблиц CHECK TABLE. На проверке таблицы событий прошло несколько минут.
2. При переключении на вкладку событий по конкретному объекту в лог медленных запросов попался вот такой (время выполнения несколько секунд):
SELECT DATE_FORMAT(ev.receivedtime, '%Y.%m.%d') receiveddate, DATE_FORMAT(ev.receivedtime, '%Y.%m.%d %H:%i:%s') receivedtime, ev.receivedtime receivedtime2, CONCAT(ev.clasificator, " ", ev.eventcode, " ", ev.zonenumber) eventcode, ev.eventname, ev.reactedtime, HEX(CAST(ev.receivedlevel AS UNSIGNED)) receivedlevel, HEX(CAST(ev.retranslatorlevel AS UNSIGNED))retranslatorlevel, IF(ev.name IS NULL, HEX(CAST(ev.retranslator AS UNSIGNED)), ev.name) retranslatorname FROM (SELECT * FROM events LEFT JOIN retranslators ON events.retranslator = retranslators.nr WHERE events.objectnr='4103' and events.linenr='1' and events.receivernr='1' and (events.repeated =2 or events.repeated = 'No') ORDER BY events.receivedtime DESC LIMIT 50) ev ORDER BY receivedtime2 DESC;

С долгим запуском можно смириться, но подвисания при запросах хотелось бы исключить. В этой связи несколько вопросов:
1. Насколько я понимаю, по железу запрос ложится прежде всего на процессор (и на жесткий диск, но на серверный ssd денег всё равно не дадут). Подскажите, пожалуйста, есть ли смысл в особой многоядерности процессора или достаточно максимально быстрого 4 ядерника? Сейчас работает Athlon X4 640 (4 ядра по 3 ГГц). Буду признателен за указание конкретной модели среднего ценового диапазона и под тот же AM3.
2. В настоящее время установлен MySQL 4.1, но если последние версии умеют распараллеливать запросы, сделаю апгрейд.
3. Как оптимально настроить MySQL? Текущие параметры my.ini были приведены выше.
Вопрос: MySQL 5.7: InnoDB: page_cleaner: 1000ms The settings might not be optimal

Вопрос что называется в лоб.

Вот такие сообщения возникают при загрузке больших объёмов из дампов, с нуля, либо через load infile или при Mysql_upgrade 5.7
После чего нагрузка на ресурсы резко падает и процесс загрузки/апгрейда начинает дико тупить.

2016-11-01T10:44:31.206025Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 5904ms. The settings might not be optimal. (flushed=74, during the time.)
2016-11-01T10:45:17.232637Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 4674ms. The settings might not be optimal. (flushed=116, during the time.)
2016-11-01T10:45:32.572635Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 4981ms. The settings might not be optimal. (flushed=91, during the time.)
2016-11-01T10:46:00.043937Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 4006ms. The settings might not be optimal. (flushed=303, during the time.)



+ my.cnf

[mysqld]

tmp_table_size              = 1G
max_tmp_tables              = 32

skip-external-locking
bind-address            = 0.0.0.0

# * Fine Tuning
max_allowed_packet      = 1G
thread_stack            = 256K
thread_cache_size       = 256

auto-increment-increment = 1
auto-increment-offset    = 1

max_connections         = 200
max_connect_errors      = 100
wait_timeout            = 10
net_read_timeout        = 30
net_write_timeout       = 30
back_log                = 128
max_heap_table_size     = 2G
myisam_sort_buffer_size = 2G
concurrent_insert = 1
low-priority-updates = 0
myisam_max_sort_file_size= 2G

# * Query Cache Configuration
query_cache_limit       = 28M
query_cache_size        = 512M

open-files-limit = 40000

# * Logging and Replication
log-error = /var/log/mysql/error.log
read_rnd_buffer_size = 256M
log-slow-admin-statements = 1

# Here you can see queries with especially long duration
long_query_time         = 2
log-queries-not-using-indexes


server-id               = 100110
log_bin                 = /var/lib/mysql/mysql-bin
log_slave_updates       = false
expire_logs_days        = 5
max_binlog_size         = 100M
binlog_format           = ROW
sync_binlog             = 0


# * InnoDB

innodb_buffer_pool_size         = 4G
innodb_log_file_size            = 5M
innodb_data_file_path           = ibdata1:10M:autoextend
innodb_flush_log_at_trx_commit  = 1
innodb_flush_method             = O_DIRECT
innodb_log_buffer_size          = 32M
innodb_thread_concurrency       = 32

innodb_file_per_table           = 1
innodb_log_files_in_group       = 2
innodb_force_recovery           = 0
innodb_support_xa               = 0

# tuning
innodb_purge_threads            = 4
flush                           = 1
flush_time                      = 10
innodb_flush_log_at_trx_commit  = 0
innodb_max_dirty_pages_pct      = 90
innodb_max_dirty_pages_pct_lwm  = 0

innodb_log_buffer_size          = 3M # equals half of innodb_log_file_size

Ответ:
miksoft
darkfox,

Сколько оперативки? Точные версии и разрядность ОС и MySQL ?


Виртуалка на AWS, m4.2xlarge: 8core/32GB RAM/SSD EBS
Вопрос: Как лучше перенести базу 1С в MySQL?

Всем привет, я на вашем форуме первый раз, но просто совсем уже отчаялся в поисках решения своей проблемы. Дали копию базы 1С сказали перелить все данные в MySQL. База не большая, около 3 млн объектов. Нашёл статью, где чувак подключается через ODBC и переливает данные, средствами 1С, но я УЖАСНО не хочу внимать в этот "язык"... Поэтому прошу, посоветуйте нормальный способ, для нормальных людей!
Ответ: В MS Sql можно создать Linked Servers, в которым через ODBC драйвер можно легко общаться с mysql.
select * from openquery (SGOSTAND, 'select cash_id,id from trm_out_receipt_header limit 100')
Где SGOSTAND это имя Linked Server.
Вопрос: Ошибка при импорте БД в MySQL - Note: table storage engine for *** doesn't have this option

Есть MySQL-server (1), настроенный давно, характеристики настройки не сохранились (инсталляционная версия 5.6.13). На нем есть БД, к которой по локальной сети обращается другой сервер (10).

Задача: Создать MySQL-server (2) – точную копию с (1), т.е. настроить из дистрибутива MySQL (1), выгрузить БД с (1), залить на (2). Критерий успешности – работающий (10) в паре с (2).

Выгрузку с (1) БД сделала HeidiSQL – Ошибок не выдал, загружаю на (2) тоже ей же;
При импорте этой БД в настроенный (2), HeidiSQL выдает ошибку.

Кликните здесь для просмотра всего текста
Ошибка при импорте БД в MySQL - Note: table storage engine for *** doesn't have this option


Сделала загрузку БД на (2) через Workbench – (10) тоже не работает.

Поиск по Google/Яндекс дает общую информацию, не приближающую к решению.

Исключила брандмауэр, проброс портов – настройки одинаковые на обоих компах.

MySQL на (2) принял и порт, и пользователя, и пароль (в ранних версиях настройки программы проблемы вылезали по этим пунктам).

Вопрос: Какие настройки при экспорте/импорте БД могут исправить эту ошибку.
Ответ: Изучение темы дало следующие результаты. Лог ошибок Name-comp.err выдал вот что:

Кликните здесь для просмотра всего текста
2015-03-28 09:38:21 3052 [Note] Plugin 'FEDERATED' is disabled.
2015-03-28 09:38:21 3052 [Warning] option 'innodb-autoextend-increment': unsigned value 67108864 adjusted to 1000
2015-03-28 09:38:22 45c InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator.
2015-03-28 09:38:22 3052 [Note] InnoDB: The InnoDB memory heap is disabled
2015-03-28 09:38:22 3052 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2015-03-28 09:38:22 3052 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-03-28 09:38:22 3052 [Note] InnoDB: Not using CPU crc32 instructions
2015-03-28 09:38:23 3052 [Note] InnoDB: Initializing buffer pool, size = 8.0M
2015-03-28 09:38:23 3052 [Note] InnoDB: Completed initialization of buffer pool
2015-03-28 09:38:23 3052 [Note] InnoDB: Highest supported file format is Barracuda.
2015-03-28 09:38:26 3052 [Note] InnoDB: 128 rollback segment(s) are active.
2015-03-28 09:38:26 3052 [Note] InnoDB: Waiting for purge to start
2015-03-28 09:38:27 3052 [Note] InnoDB: 5.6.13 started; log sequence number 1625977
2015-03-28 09:38:27 3052 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: a8a42d2e-d50c-11e4-b573-000c29a2e388.
2015-03-28 09:38:27 3052 [Note] Server hostname (bind-address): '*'; port: 33060
2015-03-28 09:38:27 3052 [Note] IPv6 is available.
2015-03-28 09:38:27 3052 [Note] - '::' resolves to '::';
2015-03-28 09:38:27 3052 [Note] Server socket created on IP: '::'.
2015-03-28 09:38:32 3052 [Note] Event Scheduler: Loaded 0 events
2015-03-28 09:38:32 3052 [Note] C:/MySQL/MySQL Server 5.6/bin\mysqld: ready for connections.
Version: '5.6.13' socket: '' port: 33060 MySQL Community Server (GPL)


Стало понятно, что не хватает каких-то библиотек... И загружаемая БД просто не распознается MySQL'ем. С учетом, что я установила MySQL в комплектации Default (по-умолчанию), а еще был вариант Full, имеет смысл переставить MySQL в полной комплектации.

Нашла статью УСТАНАВЛИВАЕМ БИБЛИОТЕКУ ДЛЯ РАБОТЫ С БАЗОЙ ДАННЫХ MYSQL (публиковать тут ссылки запрещено...)
Кликните здесь для просмотра всего текста

Как установить библиотеку для работы с базой данных MySQL
1. На оффсайте скачиваем коннектор(com.mysql.jdbc.Driver)Connector/J 5.1.18 или
скачать коннектор com.mysql.jdbc.Driver
2. смотрим в нашей IDE какую JDK мы используем, для примера /java-6-openjdk/
в директорию для linux:
/usr/lib/jvm/java-6-openjdk/jre/lib/ копируем mysql-connector-java-5.1.9-bin.jar (он в прикрепленном файле)
в директорию для Windows:
...Program Files/.../путь к вашей jdk/jre/lib/
3. далее идем в настройки нашей IDE, и в разделе JRE добавляем наш .jar
для Eclipse: Window- Prefarences- Java- Installed JREs- (клик по jdk)- Edit...- Add External JARs...

В Java коде:
Загружаем в память драйвер-
Code

try {
DriverManager.registerDriver(new com.mysql.jdbc.Driver());
} catch (Exception e) {
e.printStackTrace();
}


Подключаемся к базе -
Code

String pathConnection = "jdbc:mysql://localhost/dbname";
String nameConnection = "user";
String passConnection = "pass";
try {
conn = DriverManager.getConnection(pathConnection,
nameConnection, passConnection);
} catch (Exception e) {
e.printStackTrace();
}


Я не поняла, куда это нужно прописывать... Java у меня нет, а PHP-движок на (10). Его никто не трогал и не менял. Сейчас у меня установлено несколько версий Connector'ов. Возможно, в FULL-версии установлены еще какие-то библиотеки.

О результатах переустановки MySQL отпишусь позже.