GNU/Linux >> Tutoriels Linux >  >> Debian

Debian 9 :Après la mise à jour depuis la 8, Mysql (mariadb) ne fonctionne plus ?

Je viens de passer de Debian 8 à 9.

Apparemment, cela casse tout ce qui concerne la base de données. Je ne peux plus démarrer MySQL, l'erreur est :

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

État du service :

systemctl status mariadb.service

Affiche des erreurs :

● 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'.

Autre moyen d'obtenir des informations :

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

Comment puis-je résoudre ce problème ?

Modifier :Voici la sortie complète 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'.

Exécutez /etc/init.d/mysql start résultats :

[....] 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!

Je ne trouve pas de fichier nommé mysql.err et ps -aux|grep -i maria ne donne aucun résultat.

En relation :Comment afficher les données de table dans le dernier MySQL Workbench 6.0 ?

Réponse acceptée :

Pour une raison quelconque, vous n'avez pas le fichier /etc/mysql/debian-start , qui est l'erreur donnée :

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

J'ai vérifié mon installation de mariadb et ce fichier fait partie du mariadb-server-10.1 emballer. Vérifiez s'il y a /etc/mysql/debian-start.dpkg-dist ou similaire, si c'est le cas, renommez-le en /etc/mysql/debian-start .

Sinon, vérifiez le nom exact du package que vous avez installé :

dpkg -S /usr/bin/mysqld_safe

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

Téléchargez le package .deb (par exemple via cette page), décompressez-le :

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

(remplacez le nom du fichier que vous avez téléchargé) puis copiez le fichier :

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

Vous devriez alors pouvoir le démarrer; à moins qu'il manque d'autres fichiers. C'est étrange que ce fichier manque, donc quelque chose s'est mal passé à un moment donné.

Connexe :Problème de performances MySQL :~360 ms pour récupérer 120 lignes avec 10 colonnes ?
Debian
  1. Comment mettre à niveau le système Debian Linux de Wheezy vers la version stable de Jessie

  2. Les mots de passe MySQL ne fonctionnent pas après la mise à niveau

  3. Comment passer de Debian 10 à Debian 11

  4. Comment mettre à niveau vers Debian 11 à partir de Debian 10

  5. Logitech M515 ne fonctionne pas après la mise à niveau vers 12.04 ?

Comment mettre à jour Debian 8 Jessie vers Debian 9 Stretch

Mettre à niveau Debian 9 Stretch vers Debian 10 Buster à partir de la ligne de commande

Mettre à niveau Debian 10 Buster vers Debian 11 Bullseye à partir de la ligne de commande

Installer Zabbix sur Debian 11 Bullseye avec MySQL/MariaDB &Apache

Mettre à niveau Debian 10 Buster vers Debian 11 Bullseye à partir de la ligne de commande

Comment installer MySQL/MariaDB sur Debian 11