Getting "Failed to restart mysqld.service: Unit not found" after power failure

I am dealing with an old machine that had a power failure (at least 5 years old, but I am not sure how to check the exact version)

I am getting the following error:

Exception: SQLSTATE[HY000] [2002] Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)::SQLSTATE[HY000] [2002] Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2) in file /var/www/html/admin/libraries/utility.functions.php on line 120

I ran " service mysqld restart"

But I am getting an error of “Failed to restart mysqld.service: Unit not found”

Any suggestions?

If it’s an old enough distro or a custom install, you might not have a mysqld service, or it might have a different name… or it might be launched from a script dumped in rc.local.

Maybe try

service --status-all | grep ‘sql’

or

grep -r ‘mysql’ /etc/rc.d

Thank you both returned no results. If I remember correctly this is a pbxinaflash machine

Actually I looked at a backup file and I see files that appear to be freepbx version 15. How can I see what asterisk version it is?

You can check # asterisk -V, but that’s hardly relevant. If you need to get mysql running, your OS/version is more important. Check for /etc/system-release. You might find some mysql config info in /etc/my.cnf (or somewhere similar).

Does

which mysqld

return anything?

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