Impossible de démarrer mysql

Bonjour,

J’ai constaté que plusieurs applis ne fonctionnaient plus. L’erreur étant «database error», j’ai investigué de ce côté. Bingo: mysql était arrêté. Je tente donc un redémarrage, en vain malheureusement à en croire le statut:

● mariadb.service - MariaDB 10.1.37 database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: signal) since Sat 2019-01-12 14:41:53 CET; 3s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 1699 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=killed, signa
  Process: 1650 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`;
  Process: 1644 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCE
  Process: 1643 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCES
 Main PID: 1699 (code=killed, signal=ABRT)
   Status: "InnoDB: Fatal:  InnoDB: Unable to allocate memory of size 4294959672."
    Tasks: 0 (limit: 4915)
   CGroup: /system.slice/mariadb.service

Jan 12 14:41:53 stemy.me systemd[1]: Failed to start MariaDB 10.1.37 database server.
Jan 12 14:41:53 stemy.me systemd[1]: mariadb.service: Unit entered failed state.
Jan 12 14:41:53 stemy.me systemd[1]: mariadb.service: Failed with result 'signal'.

Étrangement, la petite pastille était verte alors que quand il y a -comme ici- un problème, elle est censée être rouge.

Puis-je y faire quelque chose sans devoir passer par un redémarrage.

hello
Que disent les logs d’erreur situés dans /var/lib/mysql/tondomaine.err?

Rien, ils sont tous vides.

euh tu es bien sûr qu’ils sont tous vides?
Je ne parle pas de /var/log/mysql mais de /var/lib/mysql
Peux-tu revérifier?

Ah OK, faut dire que ta coquille prêtait à confusion.

181208 14:25:06 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
181208 14:25:06 [Note] /usr/sbin/mysqld (mysqld 10.0.32-MariaDB-0+deb8u1) starting as process 30157 ...
181208 14:25:06 [Note] InnoDB: innodb_empty_free_list_algorithm has been changed to legacy because of small buffer pool size. In order to use backoff, increase buffer pool at least up to 20MB.

181208 14:25:06 [Note] InnoDB: Using mutexes to ref count buffer pool pages
181208 14:25:06 [Note] InnoDB: The InnoDB memory heap is disabled
181208 14:25:06 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
181208 14:25:06 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
181208 14:25:06 [Note] InnoDB: Compressed tables use zlib 1.2.8
181208 14:25:06 [Note] InnoDB: Using Linux native AIO
181208 14:25:06 [Note] InnoDB: Not using CPU crc32 instructions
181208 14:25:06 [Note] InnoDB: Initializing buffer pool, size = 128.0M
181208 14:25:06 [Note] InnoDB: Completed initialization of buffer pool
181208 14:25:06 [Note] InnoDB: Highest supported file format is Barracuda.
181208 14:25:06 [Note] InnoDB: 128 rollback segment(s) are active.
181208 14:25:06 [Note] InnoDB: Waiting for purge to start
181208 14:25:06 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.36-82.1 started; log sequence number 1616817
181208 14:25:06 [Note] Plugin 'FEEDBACK' is disabled.
181208 14:25:06 [Note] Server socket created on IP: '::'.
181208 14:25:06 [Note] /usr/sbin/mysqld: ready for connections.
Version: '10.0.32-MariaDB-0+deb8u1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Debian)
181208 14:25:08 [Note] /usr/sbin/mysqld: Normal shutdown

181208 14:25:08 [Note] Event Scheduler: Purging the queue. 0 events
181208 14:25:08 [Note] InnoDB: FTS optimize thread exiting.
181208 14:25:08 [Note] InnoDB: Starting shutdown...
181208 14:25:08 [Note] InnoDB: Waiting for page_cleaner to finish flushing of buffer pool
181208 14:25:10 [Note] InnoDB: Shutdown completed; log sequence number 1616827
181208 14:25:10 [Note] /usr/sbin/mysqld: Shutdown complete

181208 14:25:10 mysqld_safe mysqld from pid file /var/lib/mysql/stemy.me.pid ended
181208 14:25:12 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
181208 14:25:12 [Note] /usr/sbin/mysqld (mysqld 10.0.32-MariaDB-0+deb8u1) starting as process 30469 ...
181208 14:25:12 [Note] InnoDB: innodb_empty_free_list_algorithm has been changed to legacy because of small buffer pool size. In order to use backoff, increase buffer pool at least up to 20MB.

181208 14:25:12 [Note] InnoDB: Using mutexes to ref count buffer pool pages
181208 14:25:12 [Note] InnoDB: The InnoDB memory heap is disabled
181208 14:25:12 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
181208 14:25:12 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
181208 14:25:12 [Note] InnoDB: Compressed tables use zlib 1.2.8
181208 14:25:12 [Note] InnoDB: Using Linux native AIO
181208 14:25:12 [Note] InnoDB: Not using CPU crc32 instructions
181208 14:25:12 [Note] InnoDB: Initializing buffer pool, size = 128.0M
181208 14:25:12 [Note] InnoDB: Completed initialization of buffer pool
181208 14:25:12 [Note] InnoDB: Highest supported file format is Barracuda.
181208 14:25:12 [Note] InnoDB: 128 rollback segment(s) are active.
181208 14:25:12 [Note] InnoDB: Waiting for purge to start
181208 14:25:12 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.36-82.1 started; log sequence number 1616827
181208 14:25:12 [Note] Plugin 'FEEDBACK' is disabled.
181208 14:25:12 [Note] Server socket created on IP: '::'.
181208 14:25:12 [Note] /usr/sbin/mysqld: ready for connections.
Version: '10.0.32-MariaDB-0+deb8u1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Debian)
181208 17:06:19 [Note] /usr/sbin/mysqld: Normal shutdown

181208 17:06:19 [Note] Event Scheduler: Purging the queue. 0 events
181208 17:06:19 [Note] InnoDB: FTS optimize thread exiting.
181208 17:06:19 [Note] InnoDB: Starting shutdown...
181208 17:06:20 [Note] InnoDB: Waiting for page_cleaner to finish flushing of buffer pool
181208 17:06:21 [Note] InnoDB: Shutdown completed; log sequence number 1616837
181208 17:06:21 [Note] /usr/sbin/mysqld: Shutdown complete

181208 17:06:21 mysqld_safe mysqld from pid file /var/lib/mysql/stemy.me.pid ended
181208 18:53:08 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
181208 18:53:10 [Note] /usr/sbin/mysqld (mysqld 10.0.37-MariaDB-0+deb8u1) starting as process 890 ...
181208 18:53:10 [Note] InnoDB: innodb_empty_free_list_algorithm has been changed to legacy because of small buffer pool size. In order to use backoff, increase buffer pool at least up to 20MB.

181208 18:53:10 [Note] InnoDB: Using mutexes to ref count buffer pool pages
181208 18:53:10 [Note] InnoDB: The InnoDB memory heap is disabled
181208 18:53:10 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
181208 18:53:10 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
181208 18:53:10 [Note] InnoDB: Compressed tables use zlib 1.2.8
181208 18:53:10 [Note] InnoDB: Using Linux native AIO
181208 18:53:10 [Note] InnoDB: Not using CPU crc32 instructions
181208 18:53:10 [Note] InnoDB: Initializing buffer pool, size = 128.0M
181208 18:53:10 [Note] InnoDB: Completed initialization of buffer pool
181208 18:53:11 [Note] InnoDB: Highest supported file format is Barracuda.
181208 18:53:11 [Note] InnoDB: 128 rollback segment(s) are active.
181208 18:53:11 [Note] InnoDB: Waiting for purge to start
181208 18:53:11 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.39-84.1 started; log sequence number 1616837
181208 18:53:11 [Note] Plugin 'FEEDBACK' is disabled.
181208 18:53:11 [Note] Server socket created on IP: '::'.
181208 18:53:12 [Note] /usr/sbin/mysqld: ready for connections.
Version: '10.0.37-MariaDB-0+deb8u1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Debian)
181209 10:46:45 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
181209 10:46:48 [Note] /usr/sbin/mysqld (mysqld 10.0.37-MariaDB-0+deb8u1) starting as process 1030 ...
181209 10:46:48 [Note] InnoDB: innodb_empty_free_list_algorithm has been changed to legacy because of small buffer pool size. In order to use backoff, increase buffer pool at least up to 20MB.

181209 10:46:48 [Note] InnoDB: Using mutexes to ref count buffer pool pages
181209 10:46:48 [Note] InnoDB: The InnoDB memory heap is disabled
181209 10:46:48 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
181209 10:46:48 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
181209 10:46:48 [Note] InnoDB: Compressed tables use zlib 1.2.8
181209 10:46:48 [Note] InnoDB: Using Linux native AIO
181209 10:46:48 [Note] InnoDB: Not using CPU crc32 instructions
181209 10:46:48 [Note] InnoDB: Initializing buffer pool, size = 128.0M
181209 10:46:48 [Note] InnoDB: Completed initialization of buffer pool
181209 10:46:48 [Note] InnoDB: Highest supported file format is Barracuda.
181209 10:46:48 [Note] InnoDB: The log sequence numbers 1616837 and 1616837 in ibdata files do not match the log sequence number 1616847 in the ib_logfiles!
181209 10:46:48 [Note] InnoDB: Restoring possible half-written data pages from the doublewrite buffer...
181209 10:46:49 [Note] InnoDB: 128 rollback segment(s) are active.
181209 10:46:49 [Note] InnoDB: Waiting for purge to start
181209 10:46:49 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.39-84.1 started; log sequence number 1616847
181209 10:46:49 [Note] Plugin 'FEEDBACK' is disabled.
181209 10:46:49 [Note] Server socket created on IP: '::'.
181209 10:46:49 [Note] /usr/sbin/mysqld: ready for connections.
Version: '10.0.37-MariaDB-0+deb8u1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Debian)
181209 16:58:29 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
181209 16:58:31 [Note] /usr/sbin/mysqld (mysqld 10.0.37-MariaDB-0+deb8u1) starting as process 953 ...
181209 16:58:31 [Note] InnoDB: innodb_empty_free_list_algorithm has been changed to legacy because of small buffer pool size. In order to use backoff, increase buffer pool at least up to 20MB.

181209 16:58:31 [Note] InnoDB: Using mutexes to ref count buffer pool pages
181209 16:58:31 [Note] InnoDB: The InnoDB memory heap is disabled
181209 16:58:31 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
181209 16:58:31 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
181209 16:58:31 [Note] InnoDB: Compressed tables use zlib 1.2.8
181209 16:58:31 [Note] InnoDB: Using Linux native AIO
181209 16:58:31 [Note] InnoDB: Not using CPU crc32 instructions
181209 16:58:31 [Note] InnoDB: Initializing buffer pool, size = 128.0M
181209 16:58:31 [Note] InnoDB: Completed initialization of buffer pool
181209 16:58:32 [Note] InnoDB: Highest supported file format is Barracuda.
181209 16:58:32 [Note] InnoDB: The log sequence numbers 1616837 and 1616837 in ibdata files do not match the log sequence number 51220418 in the ib_logfiles!
181209 16:58:32 [Note] InnoDB: Restoring possible half-written data pages from the doublewrite buffer...
181209 16:58:33 [Note] InnoDB: 128 rollback segment(s) are active.
181209 16:58:33 [Note] InnoDB: Waiting for purge to start
181209 16:58:33 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.39-84.1 started; log sequence number 51220418
181209 16:58:33 [Note] Plugin 'FEEDBACK' is disabled.
181209 16:58:33 [Note] Server socket created on IP: '::'.
181209 16:58:33 [Note] /usr/sbin/mysqld: ready for connections.
Version: '10.0.37-MariaDB-0+deb8u1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Debian)
181209 18:13:28 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
181209 18:13:31 [Note] /usr/sbin/mysqld (mysqld 10.0.37-MariaDB-0+deb8u1) starting as process 990 ...
181209 18:13:31 [Note] InnoDB: innodb_empty_free_list_algorithm has been changed to legacy because of small buffer pool size. In order to use backoff, increase buffer pool at least up to 20MB.

181209 18:13:31 [Note] InnoDB: Using mutexes to ref count buffer pool pages
181209 18:13:31 [Note] InnoDB: The InnoDB memory heap is disabled
181209 18:13:31 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
181209 18:13:31 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
181209 18:13:31 [Note] InnoDB: Compressed tables use zlib 1.2.8
181209 18:13:31 [Note] InnoDB: Using Linux native AIO
181209 18:13:31 [Note] InnoDB: Not using CPU crc32 instructions
181209 18:13:31 [Note] InnoDB: Initializing buffer pool, size = 128.0M
181209 18:13:31 [Note] InnoDB: Completed initialization of buffer pool
181209 18:13:31 [Note] InnoDB: Highest supported file format is Barracuda.
181209 18:13:31 [Note] InnoDB: The log sequence numbers 1616837 and 1616837 in ibdata files do not match the log sequence number 51722840 in the ib_logfiles!
181209 18:13:49 [Note] InnoDB: Restoring possible half-written data pages from the doublewrite buffer...
181209 18:13:49 [Note] InnoDB: Read redo log up to LSN=51723264
181209 18:13:50 [Note] InnoDB: 128 rollback segment(s) are active.
181209 18:13:50 [Note] InnoDB: Waiting for purge to start
181209 18:13:50 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.39-84.1 started; log sequence number 51722840
181209 18:13:50 [Note] Plugin 'FEEDBACK' is disabled.
181209 18:13:50 [Note] Server socket created on IP: '::'.
181209 18:13:50 [Note] /usr/sbin/mysqld: ready for connections.
Version: '10.0.37-MariaDB-0+deb8u1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Debian)
181210 19:12:08 [Note] /usr/sbin/mysqld: Normal shutdown
181210 19:12:08 [Note] Event Scheduler: Purging the queue. 0 events
181210 19:12:08 [Note] InnoDB: FTS optimize thread exiting.
181210 19:12:08 [Note] InnoDB: Starting shutdown...
181210 19:12:09 [Note] InnoDB: Waiting for page_cleaner to finish flushing of buffer pool
181210 19:12:11 [Note] InnoDB: Shutdown completed; log sequence number 65569154
181210 19:12:11 [Note] /usr/sbin/mysqld: Shutdown complete

181210 19:12:12 mysqld_safe mysqld from pid file /var/lib/mysql/stemy.me.pid ended

Oups, coquille corrigée. merci de me l’avoir signalée.

au niveau ram t’es comment? peux tu faire un free -m et poster le résultat?

      total        used        free      shared  buff/cache   available

Mem: 495 322 33 8 139 153
Swap: 1023 422 601

C’est bizarre que ça vienne de là, parce que le swap est loin d’être rempli, je l’ai justement créé pour éviter ce genre de problème.

pour moi seul un redémarrage du serveur pourrait alléger la consommation RAM…

Il faudrait peut-être essayer de comprendre pourquoi mysql croit qu’il peut demander 4Go de RAM.

Status: "InnoDB: Fatal:  InnoDB: Unable to allocate memory of size 4294959672."

Peut-être qu’en restreignant la valeur de innodb_buffer_pool_size ça aiderait…
Par exemple en ajoutant cette ligne dans /etc/mysql/my.cnf sous la section [mysqld] :

[mysqld]
innodb_buffer_pool_size = 268435456

J’avoue que j’y crois peu mais à un moment donné, avec mysql, il faut être prêt à envisager de recourir à la magie noire.

Problème rendu obsolète par une nouvelle install.