Restored from backup, now getting cant conenct to sql error

I restored from a backup to a new server (suing the backup module) , but now I am getting a
SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)::SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
Error. Any suggestions?

Thank you

Is MariaDB/MySQL running? Is the socket there? Have you looked in the /var/lib/mysql/*err error log?

From the console, you can connect to the database using ‘mysql -u root’ and see if the service is even running.

it’s been a while since I saw this but here are my notes from when it happened to me:

FreePBX Database errors after backup restore

  1. Get old password: cat /etc/asterisk/cdr_mysql.conf.bak
  2. Get new password: Cat /etc/freepbx.conf
  3. mysql -u freepbxuser –p
    a. (enter new password)
  4. Use asterisk
  5. update freepbx_settings SET value = ‘new password’ WHERE value = ‘old password’;

If FreePBX won’t connect to asterisk and asterisk reports error:
manager.c:3537 authenticate: 127.0.0.1 failed to authenticate as ‘admin’

  1. FreePBX > settings > Advanced Settings:
  2. Change “Asterisk Manager Password” to match whatever is in /etc/asterisk/manager.conf
1 Like

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