vicidial MySQL connect ERROR: Can't connect to local MySQL

Topic:Troubleshooting vicidial MySQL connect ERROR

    In this article you are going to learn how to troubleshoot the vicidial mysql connect error which displays while logging to admin or agent portal.    

while logging into the vicidial admin or agent portal you might see the below error

vicidial MySQL connect ERROR: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'

vicidial mysql connect ERROR

What is vicidial?

Vicidial is the most popular Open-Source Contact Center Solution in the world, that incorporates a predictive dialer to enable the blended handling of inbound / outbound calls alongside inbound emails and customer website chat.

Root Causes of vicidial mysql connect error

Here is the list of root causes which leads to vicidial MySQL connect error while logging into administration portal.

1. MySQL Crashed or MySQL Stopped
2. Hard disk Lack of Space or 100% utilized
3. Server Overload
4. Forget to update the New MySQL server IP vicidial database.

vicidial Mysql crash repair

    Often you will face MySQL crash in vicidial due to various reasons like server over load, improper shutdown of servers, Insufficient disk space , bulk upload or download of data from vicidial, Too many connections like dos attack .

Here is the article for MySQL repair and tutorial on avoiding the MySQL crash in vicidial

Vicidial Disk Space full

    If the Disk space is full that is 100% occupied ,then the MySQL leads to crash due to insufficient space with too many MySQL connections. In vicidial the huge disk space will be consumed by

Recordings 
MySQL database
Log files.

For Deleting the Old Recordings ,follow my article deleting vicidial recordings older than X no of days

If you are using and running vicidial with huge data like multiple list with huge leads, Call logs more than a year or more , then this will leads to  slowdown of MySQL performance and leads to crash.

Its always best practice to delete old call logs, lead data's in vicidial ,here is my  article to delete old call log data's in vicidial database

Also delete the logs generated by linux and other services
the default log path of services in linux are /var/log
for deleting the asterisk raw logs
cd /var/log/asterisk
rm -rf  messages.*
For deleting the Webserver logs
cd /var/log/httpd/
rm -rf error.*
rm -rf acces.*
For deleting the astguiclient/vicidial logs
cd /var/log/astguiclient
delete all the files which is more than 2 days old.

Vicidial MySQL New IP update

    If you have changed your vicidial server IP or changed the MySQL server IP in cluster setup, make sure to update the new IP in the vicidial database and the astguiclient.conf file in each vicidial server.

Run the below command to update the New IP in the vicidial servers

/usr/share/astguiclient/ADMIN_update_server_ip.pl

It will prompt you to enter your old server IP and New Server IP.
Also make sure the MySQL server IP updated in the astguiclient.conf located in /etc  folder

vi /etc/astguiclient.conf
# Database connection information
VARDB_server => 192.168.1.123
VARDB_database => asterisk
VARDB_user => cron
VARDB_pass => 1234
VARDB_custom_user => custom
VARDB_custom_pass => custom1234
VARDB_port => 3306

Conclusion:

    Hope the article is helpful in solving the vicidial MySQL connect error, you have learnt how to avoid MySQL crash , Deleting old Recordings and Logs, updating the New IP address in the Vicidial Database.

    For professional support reach me on skype or telegram id: striker24x7

1 Comments
  • Ajit Kumar
    Ajit Kumar April 4, 2022 at 11:33 AM

    vicidial MySQL connect ERROR: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

Add Comment
comment url