FATAL ERROR DB Error: connect failed

I ran the update (yum install mysql-init-fixer), but the error still occurs after reboot. :frowning:

At least I have a quick fix, once I see the issue. What I don’t understand is what is causing it. Like I said, it work fine for a few days (10 days last time) and then it crashes, or it happens when I reboot.

In order to avoid this issue on boot, I’ve added a script to rc.local:

vi /etc/rc.d/rc.local
Add lines:

change to avoid DB error on startup

service mysqld stop
mv /var/lib/mysql/mysql.sock /var/lib/mysql/mysql.sock.bak
service mysqld start
service asterisk restart

Not the cleanest solution, but works.

Your script will fail if

/var/lib/mysql/mysql.sock.bak

already exists, if mysql is not running then that file needs to be deleted not moved. The official fix does (yum install mysql-init-fixer) just that by adding

rm -f /var/lib/mysql/mysql.sock

to the conf files in /etc/init, the real fix would be to patch the init file itself.