VICIdial Error: Database Connection Lost — Cause & Fix
Error Summary
Error Message
Database Connection Lost Severity
CriticalComponent
DatabaseWhat Causes This Error
VICIdial cannot connect to the MySQL/MariaDB database. This causes complete system failure — no calls can be placed, no leads can be loaded, and agents cannot log in. Causes include: MySQL service stopped, connection pool exhausted, database server out of disk space, MySQL max_connections limit reached, or network issue between VICIdial and remote database server.
How to Fix It
- 1 Check MySQL status: sudo systemctl status mysql
- 2 If stopped, check error log: sudo tail -100 /var/log/mysql/error.log
- 3 Check disk space: df -h (MySQL stops if disk is full)
- 4 Check connection count: mysql -e 'SHOW STATUS LIKE "Threads_connected"'
- 5 If connection limit reached, increase: mysql -e 'SET GLOBAL max_connections = 500'
- 6 Restart MySQL if crashed: sudo systemctl restart mysql
- 7 Verify VICIdial can connect: mysql -u cron -ptest asterisk -e 'SELECT COUNT(*) FROM vicidial_users LIMIT 1'
- 8 Restart VICIdial after database recovers
How to Prevent It
Monitor MySQL disk space and connection count. Set max_connections appropriately for your agent count. Implement automated database backup and monitoring. Consider MySQL replication for high-availability operations. Monitor slow query log to prevent query storms from exhausting connections.
Related Errors
Still Stuck?
ViciStack's free 30-day support plan includes unlimited live VICIdial troubleshooting. If you can't resolve this error with the steps above, our engineers will connect to your system and fix it directly — no support tickets, no hourly billing.
Get Free VICIdial Support →