Mysql – Lost connection to MySQL server at ‘handshake after truncating table

mariadbMySQL

I have been using Heidi SQL's latest version through an SSH tunnel to truncate a 2.5GB table. When I clicked truncate MSQL lost the connection immediately and it's not starting up ever since then, no matter if I restart the server.

I have tried looking for a solution, everyone recommends to disable the firewall, which I did and nothing changed.

When I want to start MYSQL I get this error: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)

Here is the output of systemctl status mariadb.service:

mariadb.service - MariaDB 10.2.30 database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─migrated-from-my.cnf-settings.conf
   Active: failed (Result: exit-code) since Fri 2020-01-17 20:58:40 UTC; 4min 12s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 3484 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS --basedir=/usr $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
  Process: 3271 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: 3268 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
 Main PID: 3484 (code=exited, status=1/FAILURE)
   Status: "MariaDB server is down"

Jan 17 20:58:33 server-2 systemd[1]: Starting MariaDB 10.2.30 database server...
Jan 17 20:58:34 server-2 mysqld[3484]: 2020-01-17 20:58:34 140068938262720 [Note] /usr/sbin/mysqld (mysqld 10.2.30-MariaDB) starting as process 3484 ...
Jan 17 20:58:40 server-2 systemd[1]: mariadb.service: main process exited, code=exited, status=1/FAILURE
Jan 17 20:58:40 server-2 systemd[1]: Failed to start MariaDB 10.2.30 database server.
Jan 17 20:58:40 server-2 systemd[1]: Unit mariadb.service entered failed state.
Jan 17 20:58:40 server-2 systemd[1]: mariadb.service failed.

And the output of journalctl -xe:

-- Subject: Unit session-6.scope has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-6.scope has finished starting up.
--
-- The start-up result is done.
Jan 17 21:01:01 server-2 CROND[3798]: (root) CMD (run-parts /etc/cron.hourly)
Jan 17 21:01:01 server-2 run-parts(/etc/cron.hourly)[3801]: starting 0anacron
Jan 17 21:01:01 server-2 run-parts(/etc/cron.hourly)[3807]: finished 0anacron
Jan 17 21:01:46 server-2 sshd[3896]: reverse mapping checking getaddrinfo for test-whatup.inet.co.th [203.150.221.195] failed - POSSIBLE BREAK-IN ATTEMPT!
Jan 17 21:01:46 server-2 sshd[3896]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=203.150.221.195  user=root
Jan 17 21:01:46 server-2 sshd[3896]: pam_succeed_if(sshd:auth): requirement "uid >= 1000" not met by user "root"
Jan 17 21:01:47 server-2 sshd[3900]: Invalid user mao from 157.245.243.4 port 57002
Jan 17 21:01:47 server-2 sshd[3900]: input_userauth_request: invalid user mao [preauth]
Jan 17 21:01:47 server-2 sshd[3900]: pam_unix(sshd:auth): check pass; user unknown
Jan 17 21:01:47 server-2 sshd[3900]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=157.245.243.4
Jan 17 21:01:48 server-2 sshd[3896]: Failed password for root from 203.150.221.195 port 44978 ssh2
Jan 17 21:01:48 server-2 sshd[3896]: Received disconnect from 203.150.221.195 port 44978:11: Bye Bye [preauth]
Jan 17 21:01:48 server-2 sshd[3896]: Disconnected from 203.150.221.195 port 44978 [preauth]
Jan 17 21:01:49 server-2 sshd[3900]: Failed password for invalid user mao from 157.245.243.4 port 57002 ssh2
Jan 17 21:01:49 server-2 sshd[3900]: Received disconnect from 157.245.243.4 port 57002:11: Bye Bye [preauth]
Jan 17 21:01:49 server-2 sshd[3900]: Disconnected from 157.245.243.4 port 57002 [preauth]
Jan 17 21:02:21 server-2 sshd[3958]: Invalid user ts3 from 41.224.59.78 port 38484
Jan 17 21:02:21 server-2 sshd[3958]: input_userauth_request: invalid user ts3 [preauth]
Jan 17 21:02:21 server-2 sshd[3958]: pam_unix(sshd:auth): check pass; user unknown
Jan 17 21:02:21 server-2 sshd[3958]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=41.224.59.78
Jan 17 21:02:23 server-2 sshd[3958]: Failed password for invalid user ts3 from 41.224.59.78 port 38484 ssh2
Jan 17 21:02:23 server-2 sshd[3958]: Received disconnect from 41.224.59.78 port 38484:11: Bye Bye [preauth]
Jan 17 21:02:23 server-2 sshd[3958]: Disconnected from 41.224.59.78 port 38484 [preauth]
Jan 17 21:02:26 server-2 sshd[3965]: Invalid user bill from 172.81.210.86 port 54268
Jan 17 21:02:26 server-2 sshd[3965]: input_userauth_request: invalid user bill [preauth]
Jan 17 21:02:26 server-2 sshd[3965]: pam_unix(sshd:auth): check pass; user unknown
Jan 17 21:02:26 server-2 sshd[3965]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=172.81.210.86
Jan 17 21:02:28 server-2 sshd[3965]: Failed password for invalid user bill from 172.81.210.86 port 54268 ssh2
Jan 17 21:02:28 server-2 sshd[3965]: Received disconnect from 172.81.210.86 port 54268:11: Bye Bye [preauth]
Jan 17 21:02:28 server-2 sshd[3965]: Disconnected from 172.81.210.86 port 54268 [preauth]
Jan 17 21:02:38 server-2 sshd[3979]: Invalid user dropbox from 207.154.218.16 port 41892
Jan 17 21:02:38 server-2 sshd[3979]: input_userauth_request: invalid user dropbox [preauth]
Jan 17 21:02:38 server-2 sshd[3979]: pam_unix(sshd:auth): check pass; user unknown
Jan 17 21:02:38 server-2 sshd[3979]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=207.154.218.16
Jan 17 21:02:39 server-2 sshd[3979]: Failed password for invalid user dropbox from 207.154.218.16 port 41892 ssh2
Jan 17 21:02:39 server-2 sshd[3979]: Received disconnect from 207.154.218.16 port 41892:11: Bye Bye [preauth]
Jan 17 21:02:39 server-2 sshd[3979]: Disconnected from 207.154.218.16 port 41892 [preauth]
Jan 17 21:02:58 server-2 sshd[4028]: reverse mapping checking getaddrinfo for d1-4-232-143-118-on-nets.com [118.143.232.4] failed - POSSIBLE BREAK-IN ATTEMPT!
Jan 17 21:02:58 server-2 sshd[4028]: Invalid user rasa from 118.143.232.4 port 45328
Jan 17 21:02:58 server-2 sshd[4028]: input_userauth_request: invalid user rasa [preauth]
Jan 17 21:02:58 server-2 sshd[4028]: pam_unix(sshd:auth): check pass; user unknown
Jan 17 21:02:58 server-2 sshd[4028]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=118.143.232.4
Jan 17 21:03:00 server-2 sshd[4028]: Failed password for invalid user rasa from 118.143.232.4 port 45328 ssh2
Jan 17 21:03:00 server-2 sshd[4028]: Received disconnect from 118.143.232.4 port 45328:11: Bye Bye [preauth]
Jan 17 21:03:00 server-2 sshd[4028]: Disconnected from 118.143.232.4 port 45328 [preauth]
Jan 17 21:03:22 server-2 sshd[4075]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=122.51.198.248  user=root
Jan 17 21:03:22 server-2 sshd[4075]: pam_succeed_if(sshd:auth): requirement "uid >= 1000" not met by user "root"
Jan 17 21:03:23 server-2 sshd[4075]: Failed password for root from 122.51.198.248 port 35926 ssh2
Jan 17 21:03:23 server-2 sshd[4075]: Received disconnect from 122.51.198.248 port 35926:11: Bye Bye [preauth]
Jan 17 21:03:23 server-2 sshd[4075]: Disconnected from 122.51.198.248 port 35926 [preauth]
Jan 17 21:03:50 server-2 sshd[4127]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=41.224.59.78  user=root
Jan 17 21:03:50 server-2 sshd[4127]: pam_succeed_if(sshd:auth): requirement "uid >= 1000" not met by user "root"
Jan 17 21:03:52 server-2 sshd[4127]: Failed password for root from 41.224.59.78 port 51712 ssh2
Jan 17 21:03:53 server-2 sshd[4127]: Received disconnect from 41.224.59.78 port 51712:11: Bye Bye [preauth]
Jan 17 21:03:53 server-2 sshd[4127]: Disconnected from 41.224.59.78 port 51712 [preauth]

What is going on here, why did this happen and how can I fix this?

Best Answer

It turned out that the disk space was 100% full - which I didn't expect.

I removed some files and everything started without a problem.

This post helped me to find the solution: https://stackoverflow.com/questions/46210233/status-mariadb-server-is-down