[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

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





Le 30/07/2020 à 10:00, ralf.prengel@comline.de a écrit :


-----Ursprüngliche Nachricht-----
Von: Klaus Becker <colonius47@gmail.com>
Gesendet: Mittwoch, 29. Juli 2020 21:49
An: Liste debian-user <debian-user-german@lists.debian.org>
Betreff: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'

N'abend allerseits,

auf einem frisch aufgesetzten unstable, wo sonst alles funktionniert, habe ich obiges Problem:

$ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Installiert ist

$ dpkg -l | grep mysql
ic  libreoffice-sdbc-mysql                        1:7.0.0~rc2-1
                 amd64        MariaDB/MySQL SDBC driver for LibreOffice
ii  mysql-client-5.7                              5.7.26-1+b1
                 amd64        MySQL database client binaries
ii  mysql-client-core-5.7                         5.7.26-1+b1
                 amd64        MySQL database core client binaries
ii  mysql-common                                  5.8+1.0.5
                 all          MySQL database common files, e.g.
/etc/mysql/my.cnf
ii  mysql-server-5.7                              5.7.26-1+b1
                 amd64        MySQL database server binaries and system
database setup
ii  mysql-server-core-5.7                         5.7.26-1+b1
                 amd64        MySQL database server binaries
ii  php-mysql                                     2:7.4+76
                 all          MySQL module for PHP [default]
ii  php7.4-mysql                                  7.4.5-1+b1
                 amd64        MySQL module for PHP


# systemctl start mysql
Failed to start mysql.service: Unit mysql.service not found.

Ich habe umsonst nach einer Lösung im Web gesucht. Es geht mir darum, MythTV zu benutzen, MYSQL ist dafür unabdingbar.

Gruß

Klaus
Xxx

Hast du die Datei mysql.service kontrolliert.

Gruß
Ralf Prengel


Ich bin wieder zuhause und kann die Diskussion wiederaufnehmen.

$ locate mysql.service
/etc/systemd/system/mysql.service
/usr/lib/systemd/system/mysql.service
/var/lib/systemd/deb-systemd-helper-enabled/mysql.service

$ls /etc/systemd/system/mysql.service
/etc/systemd/system/mysql.service

$ cat /etc/systemd/system/mysql.service
cat: /etc/systemd/system/mysql.service: No such file or directory


~$cat /usr/lib/systemd/system/mysql.service
# MySQL systemd service file

[Unit]
Description=MySQL Community Server
After=network.target

[Install]
WantedBy=multi-user.target

[Service]
Type=forking
User=mysql
Group=mysql
PIDFile=/run/mysqld/mysqld.pid
PermissionsStartOnly=true
ExecStartPre=/usr/share/mysql/mysql-systemd-start pre
ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid
TimeoutSec=600
Restart=on-failure
RuntimeDirectory=mysqld
RuntimeDirectory


$ export LANG=;cat /var/lib/systemd/deb-systemd-helper-enabled/mysql.service
ergibt nichts.

Ich habe versucht MythTV, für das ich Mysql brauche, mit der Option "purge" zu desinstallieren und wieder neu zu installieren.

# apt purge mysql-server-5.7
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required: libcgi-fast-perl libcgi-pm-perl libevent-core-2.1-7 libfcgi-perl libhtml-template-perl libmecab2
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  mysql-server-5.7*
0 upgraded, 0 newly installed, 1 to remove and 5 not upgraded.
1 not fully installed or removed.
After this operation, 48.1 MB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 269993 files and directories currently installed.)
Removing mysql-server-5.7 (5.7.26-1+b1) ...
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
dpkg: error processing package mysql-server-5.7 (--remove):
installed mysql-server-5.7 package pre-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
Failed to preset unit: File mysql.service: Link has been severed
/usr/bin/deb-systemd-helper: error: systemctl preset failed on mysql.service: No such file or directory
Failed to start mysql.service: Unit mysql.service not found.
invoke-rc.d: initscript mysql, action "start" failed.
Unit mysql.service could not be found.
dpkg: error while cleaning up:
installed mysql-server-5.7 package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 mysql-server-5.7
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

Aber:
# systemctl stop mysql
Failed to stop mysql.service: Unit mysql.service not loaded.

Bei meinen Versuchen, Mysql zu reparieren, wurde ich auch irgendwann auf die Datei /usr/share/doc/mysql-common/frozen-mode/downgrade hingewiesen:

"This MySQL or variant installation has entered "frozen mode". Maintainer
scripts will avoid making changes or starting the daemon until manually
released from this state. See /usr/share/doc/mysql-common/README for
general information about this mode.

In this particular case, an incompatible downgrade attempt has been
detected. This can be resolved in one of two ways:

1. Change the contents of /var/lib/mysql/ to contain database data that
is compatible with the currently installed MySQL or variant daemon
version. For example: you could restore from a backup. Alternatively you
could do a dump using a future version binary and then a restore using
the current version binary.

2. Switch to a MySQL or variant daemon version that is compatible with
the data currently in /var/lib/mysql/. For example, if you have
attempted a downgrade from mysql-server-5.7 to mysql-server-5.6, you
could "apt install mysql-server-5.7" again.

Please resolve this situation and only then remove the /etc/mysql/FROZEN
symlink. You can then run "dpkg-reconfigure <package>" where <package>
should usually be in the form <variant>-server-<version>."

"apt install mysql-server-5.7" geht zwar, löst das Problem aber nicht.

Ich habe auch nie versucht, mysql-server "downzugraden".

Noch ein Versuch:
# dpkg-reconfigure mysql-server-5.7
/usr/sbin/dpkg-reconfigure: mysql-server-5.7 is broken or not fully installed

Wenn das Ganze zu kompliziert ist, installiere ich halt Debian neu, hoffentlich mit mehr Erfolg.

Gruß

Klaus


Reply to: