Mysql dont start

SYSTEM INFORMATION
OS type and version Ubuntu Linux 20.04.4
Webmin version 1.990
Virtualmin version 6.17-3 Pro
Related packages SUGGESTED

My problem is:
The full MySQL error message was : DBI connect failed : Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)

Please Help Me

Hello,

What if you try manually restarting MySQL service by going to Webmin Servers ⇾ MySQL Database Server page or by running:

systemctl restart mysql

Thank you for your awnser, but i get the follow error:

Setting up mysql-server-8.0 (8.0.29-0ubuntu0.20.04.3) …
Specified filename /var/lib/mysql/ibdata1 does not exist.
2022-05-05T13:11:54.595611Z 0 [ERROR] [MY-011065] [Server] Unable to determine if daemon is running: No such file or directory (rc=0).
2022-05-05T13:11:54.595658Z 0 [ERROR] [MY-010946] [Server] Failed to start mysqld daemon. Check mysqld error log.
Warning: Unable to start the server.
Job for mysql.service failed because the control process exited with error code.
See “systemctl status mysql.service” and “journalctl -xe” for details.
invoke-rc.d: initscript mysql, action “start” failed.

  • mysql.service - MySQL Community Server
    Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
    Active: activating (auto-restart) (Result: exit-code) since Thu 2022-05-05 08:13:03 CDT; 4ms ago
    Process: 138493 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
    Process: 138501 ExecStart=/usr/sbin/mysqld (code=exited, status=3)
    Main PID: 138501 (code=exited, status=3)
    Status: “Server startup in progress”
    dpkg: error processing package mysql-server-8.0 (–configure):
    installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
    Errors were encountered while processing:
    mysql-server-8.0

My error list:
Setting up mysql-server-8.0 (8.0.29-0ubuntu0.20.04.3) …
Specified filename /var/lib/mysql/ibdata1 does not exist.
2022-05-05T13:11:54.595611Z 0 [ERROR] [MY-011065] [Server] Unable to determine if daemon is running: No such file or directory (rc=0).
2022-05-05T13:11:54.595658Z 0 [ERROR] [MY-010946] [Server] Failed to start mysqld daemon. Check mysqld error log.
Warning: Unable to start the server.
Job for mysql.service failed because the control process exited with error code.
See “systemctl status mysql.service” and “journalctl -xe” for details.
invoke-rc.d: initscript mysql, action “start” failed.

  • mysql.service - MySQL Community Server
    Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
    Active: activating (auto-restart) (Result: exit-code) since Thu 2022-05-05 08:13:03 CDT; 4ms ago
    Process: 138493 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
    Process: 138501 ExecStart=/usr/sbin/mysqld (code=exited, status=3)
    Main PID: 138501 (code=exited, status=3)
    Status: “Server startup in progress”
    dpkg: error processing package mysql-server-8.0 (–configure):
    installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
    Errors were encountered while processing:
    mysql-server-8.0
    Reading package lists…
    Building dependency tree…
    Reading state information…
    usermin is already the newest version (1.834).
    webmin is already the newest version (1.984).
    webmin-virtual-server is already the newest version (6.17.pro-3).
    webmin-virtual-server set to manually installed.
    webmin-virtualmin-awstats is already the newest version (5.11).
    webmin-virtualmin-htpasswd is already the newest version (3.0).
    webmin-virtualmin-nginx-ssl is already the newest version (1.16).
    webmin-virtualmin-support is already the newest version (2.4).
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    1 not fully installed or removed.
    [master 7a8cc45] saving uncommitted changes in /etc prior to apt run
    1 file changed, 4 insertions(+)
    After this operation, 0 B of additional disk space will be used.
    Setting up mysql-server-8.0 (8.0.29-0ubuntu0.20.04.3) …
    Specified filename /var/lib/mysql/ibdata1 does not exist.
    mysqld will log errors to /var/log/mysql/error.log
    2022-05-05T13:15:46.035389Z 0 [ERROR] [MY-011065] [Server] Unable to determine if daemon is running: No such file or directory (rc=0).
    2022-05-05T13:15:46.035437Z 0 [ERROR] [MY-010946] [Server] Failed to start mysqld daemon. Check mysqld error log.
    Warning: Unable to start the server.
    Job for mysql.service failed because the control process exited with error code.
    See “systemctl status mysql.service” and “journalctl -xe” for details.
    invoke-rc.d: initscript mysql, action “start” failed.
  • mysql.service - MySQL Community Server
    Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
    Active: activating (auto-restart) (Result: exit-code) since Thu 2022-05-05 08:16:58 CDT; 4ms ago
    Process: 140389 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
    Process: 140397 ExecStart=/usr/sbin/mysqld (code=exited, status=3)
    Main PID: 140397 (code=exited, status=3)
    Status: “Server startup in progress”
    dpkg: error processing package mysql-server-8.0 (–configure):
    installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
    Errors were encountered while processing:
    mysql-server-8.0
    E: Sub-process /usr/bin/dpkg returned an error code (1)

It seems that MySQL installation got corrupt/broken. It’s not clear what went wrong.

Do you have any critical data (databases) in it?

Please tell us more about what happened before this issue popped up? Perhaps, package upgrades process went incorrectly?

hi again, Do you have any critical data (databases) in it? yes.

I have three moodles that are in operation through virtual server in virtualmin, I must solve it without losing the moodles.

Is there a way to backup everything, to reinstall my entire server and use my backup and my moodle sites are whole in a few hours?

Please tell us more about what happened before this issue popped up? Perhaps, package upgrades process went incorrectly?

Before this error, it happened to me that the mysql server stopped, but I only needed to go to start it and run mysql again, but since yesterday at approximately 8:00 pm this was no longer possible and I get these errors, previously with restarting the whole server mysql was working again but now no luck.

I have three moodles that are in operation through virtual server in virtualmin, I must solve it without losing the moodles.

This may be more complex task depending on what happened. The easiest way would be restoring from a previous backup or snapshot.

Is there a way to backup everything, to reinstall my entire server and use my backup and my moodle sites are whole in a few hours?

In order to backup a database, MySQL should be running. It depends if /var/lib/mysql was corrupt. You could try to spin up a new system, install Virtualmin using install.sh script, stop mysql.service and rsync using archive mode (to preserve permission) MySQL /var/lib/mysql directory from old server to the new.

Although, I would first suggest trying the following:

dpkg --configure -a
apt-get install --reinstall mysql-client mysql-common mysql-server mysql-server

Also, have a look at what apt-get update and apt-get upgrade return.

thanks, i will do

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.