Please help everyone. I have a disaster in Cannot log in to the MySQL server

Hello, my friends, I hope you all can help me. A disaster happened to me and I could not solve this problem and I could not go back to the way before the problem. I hope you can help me solve my problem that I am suffering from. Until now, I have not been able to reach a solution.

Cannot log in to the MySQL server

mysqli::real_connect(): Error while reading greeting packet. PID=1498364

mysqli::real_connect(): (HY000/2006): MySQL server has gone away

Connection for controluser as defined in your configuration failed.

mysqli::real_connect(): (HY000/2002): No such file or directory

sytemctl status mysql

Thank you for the quick response and your help.

root@cp:~# sytemctl status mysql
Command ‘sytemctl’ not found, did you mean:
command ‘systemctl’ from deb systemd (249.11-0ubuntu3.16)
command ‘systemctl’ from deb systemctl (1.4.4181-1.1)
Try: apt install
root@cp:~#

I can’t even make any backup via Download Database.

systemctl status mysql

Probally mysql is not running

This is the message I received via my email.

Can’t connect to MySQL localhost:3306
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)

This is a picture of the hestiacp admin panel. It is working, but it may be hanging or not working normally.

mysql

I tried again this one showed up.

root@cp:~# systemctl status mysql
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: activating (start-pre) since Tue 2025-09-02 12:36:36 CEST; 12ms ago
Cntrl PID: 1538390 (mysql-systemd-s)
Tasks: 6 (limit: 14279)
Memory: 2.1M
CPU: 13ms
CGroup: /system.slice/mysql.service
├─1538390 /bin/bash /usr/share/mysql/mysql-systemd-start pre
├─1538397 /bin/bash /usr/share/mysql/mysql-systemd-start pre
└─1538398 “[mysqld]”

Sep 02 12:36:36 cp.haraj-sooq.store systemd[1]: Starting MySQL Community Server…
root@cp:~#

This issue has been resolved in this post.