GNU/Linux >> Tutoriales Linux >  >> Debian

Debian 9:después de la actualización de 8, ¿Mysql (mariadb) ya no funciona?

Acabo de actualizar Debian 8 a 9.

Aparentemente, rompe todo lo relacionado con la base de datos. Ahora no puedo iniciar MySQL, el error es:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")

Estado del servicio:

systemctl status mariadb.service

Muestra errores:

● mariadb.service - MariaDB database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2018-02-02 16:55:27 AEST; 35s ago
  Process: 6859 ExecStartPost=/etc/mysql/debian-start (code=exited, status=203/EXEC)
  Process: 6832 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 6821 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
  Process: 6815 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 6814 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
 Main PID: 6832 (code=exited, status=0/SUCCESS)
   Status: "MariaDB server is down"

2 02 16:55:25 doraemoe mysqld[6832]: 2018-02-02 16:55:25 140495303359232 [Note] /usr/sbin/mysqld: Normal shutdown
2 02 16:55:25 doraemoe mysqld[6832]: 2018-02-02 16:55:25 140495303359232 [Note] Event Scheduler: Purging the queue. 0 events
2 02 16:55:25 doraemoe mysqld[6832]: 2018-02-02 16:55:25 140494621349632 [Note] InnoDB: FTS optimize thread exiting.
2 02 16:55:25 doraemoe mysqld[6832]: 2018-02-02 16:55:25 140495303359232 [Note] InnoDB: Starting shutdown...
2 02 16:55:26 doraemoe mysqld[6832]: 2018-02-02 16:55:26 140495303359232 [Note] InnoDB: Waiting for page_cleaner to finish flushing of buffer pool
2 02 16:55:27 doraemoe mysqld[6832]: 2018-02-02 16:55:27 140495303359232 [Note] InnoDB: Shutdown completed; log sequence number 1616889
2 02 16:55:27 doraemoe mysqld[6832]: 2018-02-02 16:55:27 140495303359232 [Note] /usr/sbin/mysqld: Shutdown complete
2 02 16:55:27 doraemoe systemd[1]: Failed to start MariaDB database server.
2 02 16:55:27 doraemoe systemd[1]: mariadb.service: Unit entered failed state.
2 02 16:55:27 doraemoe systemd[1]: mariadb.service: Failed with result 'exit-code'.

Otra forma de obtener información:

journalctl -xe` that maybe useful: `2 02 16:42:39 doraemoe systemd[5505]: mariadb.service: Failed at step EXEC spawning /etc/mysql/debian-start: No such file or directory

¿Cómo lo soluciono?

Editar :Aquí está la salida completa de journalctl -u mariadb.service

Logs begin at Fri 2018-02-02 16:36:33 AEST, end at Fri 2018-02-02 19:05:01 AEST. 
2月 02 16:36:35 doraemoe systemd[1]: Starting MariaDB database server...
2月 02 16:36:36 doraemoe mysqld[3534]: 2018-02-02 16:36:36 139856107147840 [Note] /usr/sbin/mysqld (mysqld 10.1.26-MariaDB-0+deb9u1) starting as process 3534 ...
2月 02 16:36:36 doraemoe mysqld[3534]: 2018-02-02 16:36:36 139856107147840 [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.
2月 02 16:36:36 doraemoe mysqld[3534]: 2018-02-02 16:36:36 139856107147840 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2月 02 16:36:36 doraemoe mysqld[3534]: 2018-02-02 16:36:36 139856107147840 [Note] InnoDB: The InnoDB memory heap is disabled
2月 02 16:36:36 doraemoe mysqld[3534]: 2018-02-02 16:36:36 139856107147840 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2月 02 16:36:36 doraemoe mysqld[3534]: 2018-02-02 16:36:36 139856107147840 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2月 02 16:36:36 doraemoe mysqld[3534]: 2018-02-02 16:36:36 139856107147840 [Note] InnoDB: Compressed tables use zlib 1.2.8
2月 02 16:36:36 doraemoe mysqld[3534]: 2018-02-02 16:36:36 139856107147840 [Note] InnoDB: Using Linux native AIO
2月 02 16:36:36 doraemoe mysqld[3534]: 2018-02-02 16:36:36 139856107147840 [Note] InnoDB: Using SSE crc32 instructions
2月 02 16:36:36 doraemoe mysqld[3534]: 2018-02-02 16:36:36 139856107147840 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2月 02 16:36:36 doraemoe mysqld[3534]: 2018-02-02 16:36:36 139856107147840 [Note] InnoDB: Completed initialization of buffer pool
2月 02 16:36:36 doraemoe mysqld[3534]: 2018-02-02 16:36:36 139856107147840 [Note] InnoDB: Highest supported file format is Barracuda.
2月 02 16:36:36 doraemoe mysqld[3534]: 2018-02-02 16:36:36 139856107147840 [Note] InnoDB: 128 rollback segment(s) are active.
2月 02 16:36:36 doraemoe mysqld[3534]: 2018-02-02 16:36:36 139856107147840 [Note] InnoDB: Waiting for purge to start
2月 02 16:36:36 doraemoe mysqld[3534]: 2018-02-02 16:36:36 139856107147840 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.36-82.1 started; log sequence number 1616859
2月 02 16:36:36 doraemoe mysqld[3534]: 2018-02-02 16:36:36 139856107147840 [Note] Plugin 'FEEDBACK' is disabled.
2月 02 16:36:36 doraemoe mysqld[3534]: 2018-02-02 16:36:36 139856107147840 [Note] Server socket created on IP: '::'.
2月 02 16:36:36 doraemoe mysqld[3534]: 2018-02-02 16:36:36 139855396824832 [Note] InnoDB: Dumping buffer pool(s) not yet started
2月 02 16:36:36 doraemoe mysqld[3534]: 2018-02-02 16:36:36 139856107147840 [Note] /usr/sbin/mysqld: ready for connections.
2月 02 16:36:36 doraemoe mysqld[3534]: Version: '10.1.26-MariaDB-0+deb9u1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  Debian 9.1
2月 02 16:36:36 doraemoe systemd[3810]: mariadb.service: Failed at step EXEC spawning /etc/mysql/debian-start: No such file or directory
2月 02 16:36:36 doraemoe systemd[1]: mariadb.service: Control process exited, code=exited status=203
2月 02 16:36:36 doraemoe mysqld[3534]: 2018-02-02 16:36:36 139856106375936 [Note] /usr/sbin/mysqld: Normal shutdown
2月 02 16:36:36 doraemoe mysqld[3534]: 2018-02-02 16:36:36 139856106375936 [Note] Event Scheduler: Purging the queue. 0 events
2月 02 16:36:36 doraemoe mysqld[3534]: 2018-02-02 16:36:36 139855422002944 [Note] InnoDB: FTS optimize thread exiting.
2月 02 16:36:36 doraemoe mysqld[3534]: 2018-02-02 16:36:36 139856106375936 [Note] InnoDB: Starting shutdown...
2月 02 16:36:37 doraemoe mysqld[3534]: 2018-02-02 16:36:37 139856106375936 [Note] InnoDB: Waiting for page_cleaner to finish flushing of buffer pool
2月 02 16:36:39 doraemoe mysqld[3534]: 2018-02-02 16:36:39 139856106375936 [Note] InnoDB: Shutdown completed; log sequence number 1616869
2月 02 16:36:39 doraemoe mysqld[3534]: 2018-02-02 16:36:39 139856106375936 [Note] /usr/sbin/mysqld: Shutdown complete
2月 02 16:36:39 doraemoe systemd[1]: Failed to start MariaDB database server.
2月 02 16:36:39 doraemoe systemd[1]: mariadb.service: Unit entered failed state.
2月 02 16:36:39 doraemoe systemd[1]: mariadb.service: Failed with result 'exit-code'.
2月 02 16:42:39 doraemoe systemd[1]: Starting MariaDB database server...
2月 02 16:42:39 doraemoe mysqld[5478]: 2018-02-02 16:42:39 140597204075072 [Note] /usr/sbin/mysqld (mysqld 10.1.26-MariaDB-0+deb9u1) starting as process 5478 ...
2月 02 16:42:39 doraemoe mysqld[5478]: 2018-02-02 16:42:39 140597204075072 [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.
2月 02 16:42:39 doraemoe mysqld[5478]: 2018-02-02 16:42:39 140597204075072 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2月 02 16:42:39 doraemoe mysqld[5478]: 2018-02-02 16:42:39 140597204075072 [Note] InnoDB: The InnoDB memory heap is disabled
2月 02 16:42:39 doraemoe mysqld[5478]: 2018-02-02 16:42:39 140597204075072 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2月 02 16:42:39 doraemoe mysqld[5478]: 2018-02-02 16:42:39 140597204075072 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2月 02 16:42:39 doraemoe mysqld[5478]: 2018-02-02 16:42:39 140597204075072 [Note] InnoDB: Compressed tables use zlib 1.2.8
2月 02 16:42:39 doraemoe mysqld[5478]: 2018-02-02 16:42:39 140597204075072 [Note] InnoDB: Using Linux native AIO
2月 02 16:42:39 doraemoe mysqld[5478]: 2018-02-02 16:42:39 140597204075072 [Note] InnoDB: Using SSE crc32 instructions
2月 02 16:42:39 doraemoe mysqld[5478]: 2018-02-02 16:42:39 140597204075072 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2月 02 16:42:39 doraemoe mysqld[5478]: 2018-02-02 16:42:39 140597204075072 [Note] InnoDB: Completed initialization of buffer pool
2月 02 16:42:39 doraemoe mysqld[5478]: 2018-02-02 16:42:39 140597204075072 [Note] InnoDB: Highest supported file format is Barracuda.
2月 02 16:42:39 doraemoe mysqld[5478]: 2018-02-02 16:42:39 140597204075072 [Note] InnoDB: 128 rollback segment(s) are active.
2月 02 16:42:39 doraemoe mysqld[5478]: 2018-02-02 16:42:39 140597204075072 [Note] InnoDB: Waiting for purge to start
2月 02 16:42:39 doraemoe mysqld[5478]: 2018-02-02 16:42:39 140597204075072 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.36-82.1 started; log sequence number 1616869
2月 02 16:42:39 doraemoe mysqld[5478]: 2018-02-02 16:42:39 140597204075072 [Note] Plugin 'FEEDBACK' is disabled.
2月 02 16:42:39 doraemoe mysqld[5478]: 2018-02-02 16:42:39 140596496787200 [Note] InnoDB: Dumping buffer pool(s) not yet started
2月 02 16:42:39 doraemoe mysqld[5478]: 2018-02-02 16:42:39 140597204075072 [Note] Server socket created on IP: '::'.
2月 02 16:42:39 doraemoe mysqld[5478]: 2018-02-02 16:42:39 140597204075072 [Note] /usr/sbin/mysqld: ready for connections.
2月 02 16:42:39 doraemoe mysqld[5478]: Version: '10.1.26-MariaDB-0+deb9u1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  Debian 9.1
2月 02 16:42:39 doraemoe systemd[5505]: mariadb.service: Failed at step EXEC spawning /etc/mysql/debian-start: No such file or directory
2月 02 16:42:39 doraemoe systemd[1]: mariadb.service: Control process exited, code=exited status=203
2月 02 16:42:39 doraemoe mysqld[5478]: 2018-02-02 16:42:39 140597203303168 [Note] /usr/sbin/mysqld: Normal shutdown
2月 02 16:42:39 doraemoe mysqld[5478]: 2018-02-02 16:42:39 140597203303168 [Note] Event Scheduler: Purging the queue. 0 events
2月 02 16:42:39 doraemoe mysqld[5478]: 2018-02-02 16:42:39 140596521965312 [Note] InnoDB: FTS optimize thread exiting.
2月 02 16:42:39 doraemoe mysqld[5478]: 2018-02-02 16:42:39 140597203303168 [Note] InnoDB: Starting shutdown...
2月 02 16:42:40 doraemoe mysqld[5478]: 2018-02-02 16:42:40 140597203303168 [Note] InnoDB: Waiting for page_cleaner to finish flushing of buffer pool
2月 02 16:42:42 doraemoe mysqld[5478]: 2018-02-02 16:42:42 140597203303168 [Note] InnoDB: Shutdown completed; log sequence number 1616879
2月 02 16:42:42 doraemoe mysqld[5478]: 2018-02-02 16:42:42 140597203303168 [Note] /usr/sbin/mysqld: Shutdown complete
2月 02 16:42:42 doraemoe systemd[1]: Failed to start MariaDB database server.
2月 02 16:42:42 doraemoe systemd[1]: mariadb.service: Unit entered failed state.
2月 02 16:42:42 doraemoe systemd[1]: mariadb.service: Failed with result 'exit-code'.
2月 02 16:55:24 doraemoe systemd[1]: Starting MariaDB database server...
2月 02 16:55:24 doraemoe mysqld[6832]: 2018-02-02 16:55:24 140495304131136 [Note] /usr/sbin/mysqld (mysqld 10.1.26-MariaDB-0+deb9u1) starting as process 6832 ...
2月 02 16:55:24 doraemoe mysqld[6832]: 2018-02-02 16:55:24 140495304131136 [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.
2月 02 16:55:24 doraemoe mysqld[6832]: 2018-02-02 16:55:24 140495304131136 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2月 02 16:55:24 doraemoe mysqld[6832]: 2018-02-02 16:55:24 140495304131136 [Note] InnoDB: The InnoDB memory heap is disabled
2月 02 16:55:24 doraemoe mysqld[6832]: 2018-02-02 16:55:24 140495304131136 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2月 02 16:55:24 doraemoe mysqld[6832]: 2018-02-02 16:55:24 140495304131136 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2月 02 16:55:24 doraemoe mysqld[6832]: 2018-02-02 16:55:24 140495304131136 [Note] InnoDB: Compressed tables use zlib 1.2.8
2月 02 16:55:24 doraemoe mysqld[6832]: 2018-02-02 16:55:24 140495304131136 [Note] InnoDB: Using Linux native AIO
2月 02 16:55:24 doraemoe mysqld[6832]: 2018-02-02 16:55:24 140495304131136 [Note] InnoDB: Using SSE crc32 instructions
2月 02 16:55:24 doraemoe mysqld[6832]: 2018-02-02 16:55:24 140495304131136 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2月 02 16:55:24 doraemoe mysqld[6832]: 2018-02-02 16:55:24 140495304131136 [Note] InnoDB: Completed initialization of buffer pool
2月 02 16:55:24 doraemoe mysqld[6832]: 2018-02-02 16:55:24 140495304131136 [Note] InnoDB: Highest supported file format is Barracuda.
2月 02 16:55:25 doraemoe mysqld[6832]: 2018-02-02 16:55:25 140495304131136 [Note] InnoDB: 128 rollback segment(s) are active.
2月 02 16:55:25 doraemoe mysqld[6832]: 2018-02-02 16:55:25 140495304131136 [Note] InnoDB: Waiting for purge to start
2月 02 16:55:25 doraemoe mysqld[6832]: 2018-02-02 16:55:25 140495304131136 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.36-82.1 started; log sequence number 1616879
2月 02 16:55:25 doraemoe mysqld[6832]: 2018-02-02 16:55:25 140495304131136 [Note] Plugin 'FEEDBACK' is disabled.
2月 02 16:55:25 doraemoe mysqld[6832]: 2018-02-02 16:55:25 140494596171520 [Note] InnoDB: Dumping buffer pool(s) not yet started
2月 02 16:55:25 doraemoe mysqld[6832]: 2018-02-02 16:55:25 140495304131136 [Note] Server socket created on IP: '::'.
2月 02 16:55:25 doraemoe mysqld[6832]: 2018-02-02 16:55:25 140495304131136 [Note] /usr/sbin/mysqld: ready for connections.
2月 02 16:55:25 doraemoe mysqld[6832]: Version: '10.1.26-MariaDB-0+deb9u1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  Debian 9.1
2月 02 16:55:25 doraemoe systemd[6859]: mariadb.service: Failed at step EXEC spawning /etc/mysql/debian-start: No such file or directory
2月 02 16:55:25 doraemoe systemd[1]: mariadb.service: Control process exited, code=exited status=203
2月 02 16:55:25 doraemoe mysqld[6832]: 2018-02-02 16:55:25 140495303359232 [Note] /usr/sbin/mysqld: Normal shutdown
2月 02 16:55:25 doraemoe mysqld[6832]: 2018-02-02 16:55:25 140495303359232 [Note] Event Scheduler: Purging the queue. 0 events
2月 02 16:55:25 doraemoe mysqld[6832]: 2018-02-02 16:55:25 140494621349632 [Note] InnoDB: FTS optimize thread exiting.
2月 02 16:55:25 doraemoe mysqld[6832]: 2018-02-02 16:55:25 140495303359232 [Note] InnoDB: Starting shutdown...
2月 02 16:55:26 doraemoe mysqld[6832]: 2018-02-02 16:55:26 140495303359232 [Note] InnoDB: Waiting for page_cleaner to finish flushing of buffer pool
2月 02 16:55:27 doraemoe mysqld[6832]: 2018-02-02 16:55:27 140495303359232 [Note] InnoDB: Shutdown completed; log sequence number 1616889
2月 02 16:55:27 doraemoe mysqld[6832]: 2018-02-02 16:55:27 140495303359232 [Note] /usr/sbin/mysqld: Shutdown complete
2月 02 16:55:27 doraemoe systemd[1]: Failed to start MariaDB database server.
2月 02 16:55:27 doraemoe systemd[1]: mariadb.service: Unit entered failed state.
2月 02 16:55:27 doraemoe systemd[1]: mariadb.service: Failed with result 'exit-code'.

Ejecute /etc/init.d/mysql start resultados:

[....] Starting mysql (via systemctl): mysql.serviceJob for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
 failed!

No puedo encontrar un archivo llamado mysql.err y ps -aux|grep -i maria no produce ningún resultado.

Relacionado:¿Cómo ver los datos de la tabla en el MySQL Workbench 6.0 más reciente?

Respuesta aceptada:

Por alguna razón, no tiene el archivo /etc/mysql/debian-start , que es el error dado:

16:55:25 doraemoe systemd[6859]: mariadb.service: Failed at step EXEC spawning /etc/mysql/debian-start: No such file or directory

He comprobado mi instalación de mariadb y ese archivo es parte del mariadb-server-10.1 paquete. Compruebe si hay /etc/mysql/debian-start.dpkg-dist o similar, si es así, cambie el nombre a /etc/mysql/debian-start .

De lo contrario, verifique qué nombre de paquete exacto ha instalado:

dpkg -S /usr/bin/mysqld_safe

mariadb-server-10.1: /usr/bin/mysqld_safe

Descargue el paquete .deb (por ejemplo, a través de esta página), descomprímalo:

dpkg-deb --extract mariadb-server-10.1_10.1.26-0+deb9u1_amd64.deb /tmp/mariadb-server

(sustituya el nombre del archivo que descargó) y luego copie el archivo:

cp /tmp/mariadb-server/etc/mysql/debian-start /etc/mysql/

Entonces debería poder iniciarlo; a menos que falten más archivos. Es extraño que falte este archivo, por lo que algo salió mal en algún momento.

Relacionado:Problema de rendimiento de MySQL:¿~360 ms para obtener 120 filas con 10 columnas?
Debian
  1. Cómo actualizar el sistema Debian Linux de Wheezy a la versión estable de Jessie

  2. Cómo actualizar de Debian 10 a Debian 11

  3. Cómo actualizar a Debian 11 desde Debian 10

  4. ¿Logitech M515 no funciona después de actualizar a 12.04?

  5. Debian:la interfaz de red ya no funciona después de la actualización/actualización

Cómo actualizar de Debian 8 Jessie a Debian 9 Stretch

Actualice Debian 9 Stretch a Debian 10 Buster desde la línea de comandos

Actualice Debian 10 Buster a Debian 11 Bullseye desde la línea de comandos

Instale Zabbix en Debian 11 Bullseye con MySQL/MariaDB y Apache

Actualice Debian 10 Buster a Debian 11 Bullseye desde la línea de comandos

Cómo instalar MySQL/MariaDB en Debian 11