[gelöst] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Debian macht sich hervorragend als Web- und Mailserver. Schau auch in den " Tipps und Tricks"-Bereich.
Antworten
jcw
Beiträge: 99
Registriert: 10.01.2016 17:11:46

[gelöst] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Beitrag von jcw » 04.08.2017 20:17:45

Hallo!

Ich hatte ein System neu installiert und alles lief. Nach einem apt-get update und apt-get upgrade läuft mysql nicht mehr.

Mein System:
Linux jw03 4.9.35+ #1014 Fri Jun 30 14:34:49 BST 2017 armv6l GNU/Linux
Fehler:

Code: Alles auswählen

root@jw03:/var/run/mysqld# systemctl status mysql.service
● mysql.service - LSB: Start and stop the mysql database server daemon
   Loaded: loaded (/etc/init.d/mysql)
   Active: failed (Result: exit-code) since Fri 2017-08-04 19:19:00 CEST; 35min ago
  Process: 8806 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)

Aug 04 19:19:00 jw03 /etc/init.d/mysql[9533]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
Aug 04 19:19:00 jw03 mysql[8806]: Starting MySQL database server: mysqld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . failed!
Aug 04 19:19:00 jw03 systemd[1]: mysql.service: control process exited, code=exited status=1
Aug 04 19:19:00 jw03 systemd[1]: Failed to start LSB: Start and stop the mysql database server daemon.
Aug 04 19:19:00 jw03 systemd[1]: Unit mysql.service entered failed state.[/quote]

[quote]journalctl -b | grep mysql
Aug 04 19:56:35 jw03 systemd[1]: Starting LSB: Start and stop the mysql database server daemon...
Aug 04 19:57:13 jw03 /etc/init.d/mysql[10415]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
Aug 04 19:57:13 jw03 /etc/init.d/mysql[10415]: [61B blob data]
Aug 04 19:57:13 jw03 /etc/init.d/mysql[10415]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Aug 04 19:57:13 jw03 /etc/init.d/mysql[10415]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
Aug 04 19:57:13 jw03 /etc/init.d/mysql[10415]: 
Aug 04 19:57:13 jw03 mysql[9687]: Starting MySQL database server: mysqld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . failed!
Aug 04 19:57:13 jw03 systemd[1]: mysql.service: control process exited, code=exited status=1
Aug 04 19:57:13 jw03 systemd[1]: Failed to start LSB: Start and stop the mysql database server daemon.
Aug 04 19:57:13 jw03 systemd[1]: Unit mysql.service entered failed state

Code: Alles auswählen

root@jw03:/var/run# ls -lh
total 40K
drwxr-xr-x  2 avahi    avahi      80 Aug  4 15:50 avahi-daemon
-rw-r--r--  1 root     root        4 Aug  4 15:50 crond.pid
----------  1 root     root        0 Aug  4 15:50 crond.reboot
drwxr-xr-x  2 root     root       60 Aug  4 15:50 dbus
drwxr-xr-x  3 root     root       80 Aug  4 15:50 dhcpcd
-rw-r--r--  1 root     root        4 Aug  4 15:50 dhcpcd.pid
srw-rw----  1 root     root        0 Aug  4 15:50 dhcpcd.sock
srw-rw-rw-  1 root     root        0 Aug  4 15:50 dhcpcd.unpriv.sock
drwxr-xr-x  2 root     root       60 Aug  4 15:50 dnsmasq
drwxr-xr-x  2 root     root       80 Aug  4 15:51 fail2ban
lrwxrwxrwx  1 root     root       25 Aug  4 15:50 initctl -> /run/systemd/initctl/fifo
drwxrwxrwt  4 root     root      100 Aug  4 15:50 lock
drwxr-xr-x  3 root     root       60 Aug  4 15:49 log
-rw-r--r--  1 root     root       33 Jan  1  1970 machine-id
drwxr-xr-x  2 root     root       60 Aug  4 15:50 mount
drwxr-xr-x  2 mysql    root       40 Aug  4 19:56 mysqld
drwxr-xr-x  2 root     netdev     80 Aug  4 15:50 network
-rw-r--r--  1 root     root        4 Aug  4 15:50 nginx.pid
-rw-r--r--  1 root     root        3 Aug  4 15:50 ntpd.pid
-rw-r--r--  1 root     root        3 Aug  4 15:50 php5-fpm.pid
srw-rw----  1 www-data www-data    0 Aug  4 15:50 php5-fpm.sock
drwxr-xr-x  2 root     root       40 Aug  4 15:50 plymouth
drwxr-xr-x  4 root     root       80 Aug  4 15:50 resolvconf
-rw-r--r--  1 root     root        4 Aug  4 15:50 rsyslogd.pid
drwxr-xr-x  4 root     root      360 Aug  4 15:51 samba
drwxr-xr-x  2 root     root       40 Aug  4 15:50 sendsigs.omit.d
lrwxrwxrwx  1 root     root        8 Aug  4 15:50 shm -> /dev/shm
drwxr-xr-x  2 root     root       40 Aug  4 15:50 sshd
-rw-r--r--  1 root     root        4 Aug  4 15:50 sshd.pid
drwxr-xr-x 16 root     root      380 Aug  4 15:50 systemd
-rw-r--r--  1 root     root        4 Aug  4 15:50 thd.pid
srwxr-xr-x  1 root     root        0 Aug  4 15:50 thd.socket
drwxr-xr-x  2 root     root       60 Aug  4 15:49 tmpfiles.d
drwxr-xr-x  7 root     root      160 Aug  4 18:08 udev
drwxr-xr-x  2 root     root       40 Aug  4 15:50 user
-rw-rw-r--  1 root     utmp     2.3K Aug  4 17:59 utmp
cat /etc/mysql/my.cnf
pastebin/?mode=view&s=39928

Code: Alles auswählen

root@jw03:/var/run/mysqld# ls
root@jw03:/var/run/mysqld# 

Code: Alles auswählen

root@jw03:/var/log/mysql#
nano /var/log/mysql/error.log
pastebin/?mode=view&s=39929

Code: Alles auswählen

root@jw03:/etc# dpkg -l | grep -i ^ii | grep -i mysql
ii  libdbd-mysql-perl                 4.028-2+deb8u2                   armhf        Perl5 database interface to the MySQL database
ii  libmysqlclient18:armhf            5.5.57-0+deb8u1                  armhf        MySQL database client library
ii  mysql-client                      5.5.57-0+deb8u1                  all          MySQL database client (metapackage depending on the latest version)
ii  mysql-client-5.5                  5.5.57-0+deb8u1                  armhf        MySQL database client binaries
ii  mysql-common                      5.5.57-0+deb8u1                  all          MySQL database common files, e.g. /etc/mysql/my.cnf
ii  mysql-server                      5.5.57-0+deb8u1                  all          MySQL database server (metapackage depending on the latest version)
ii  mysql-server-5.5                  5.5.57-0+deb8u1                  armhf        MySQL database server binaries and system database setup
ii  mysql-server-core-5.5             5.5.57-0+deb8u1                  armhf        MySQL database server binaries
ii  php5-mysql                        5.6.30+dfsg-0+deb8u1             armhf        MySQL module for php5
ii  python-mysql.connector            1.2.3-2                          all          pure Python implementation of MySQL Client/Server protocol
Ich habe schon Stunden verbracht, um vorgeschlagene Lösungen auszuprobieren. Leider funktioniert es nicht. Wie löse ich das Problem oder muss ich neu installieren? Danke und Gruß!
Zuletzt geändert von jcw am 06.08.2017 18:04:55, insgesamt 1-mal geändert.

jcw
Beiträge: 99
Registriert: 10.01.2016 17:11:46

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

Beitrag von jcw » 05.08.2017 07:12:23

Hat niemand eine Idee? Das Problem muss doch bei anderen Usern auch aufgetreten sein. Wie kein ein Update die Installation so beschädigen?

DeletedUserReAsG

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

Beitrag von DeletedUserReAsG » 05.08.2017 07:58:55

Code: Alles auswählen

170804 19:56:40  InnoDB: Error: page 8 log sequence number 1152921504608440764
InnoDB: is in the future! Current system log sequence number 1595685.
InnoDB: Your database may be corrupt or you may have copied the InnoDB
InnoDB: tablespace but not the InnoDB log files. See
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html
InnoDB: for more information.
InnoDB: Database page corruption on disk or a failed
InnoDB: file read of page 8.
InnoDB: You may have to recover from a backup.
… ist der relevante Teil samt Lösungsvorschlag.

Von alleine passiert das in der Regel nicht – wenn du sicher bist, die betreffenden Dateien nicht selbst angefasst zu haben, würde ich den Datenträger mal einer gründlichen Inspektion unterziehen. ARMv6 deutet auf sowas wie’n Pi hin, eine intensiv genutzte SD-Karte kann schon mal ziemlich schnell Ausfallerscheinungen zeigen. Wenn es noch übertaktet sein sollte, steigt die Wahrscheinlichkeit für FS-Schäden zudem noch drastisch an – aber zum System hast du ja nix geschrieben.

jcw
Beiträge: 99
Registriert: 10.01.2016 17:11:46

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

Beitrag von jcw » 06.08.2017 18:03:49

Danke für die Rückmeldung. In der Tat, es handelt sich um einen Raspberry Pi. Und die SD-Karte war nach einen Jahr Dauerbetrieb beschädigt. Da hilft nur Neuinstallation auf neuer Karte. In der Hoffnung, dass die neue Karte robuster ist.

Antworten