Quick Reference

Error Database Connection Lost
Severity Critical
Component Database

Database Connection Lost

What 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.

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.

Frequently Asked Questions

What causes the VICIdial "Database Connection Lost" 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 do I fix the VICIdial "Database Connection Lost" error? +

Check MySQL status: sudo systemctl status mysql Then: If stopped, check error log: sudo tail -100 /var/log/mysql/error.log Then: Check disk space: df -h (MySQL stops if disk is full) Then: Check connection count: mysql -e 'SHOW STATUS LIKE "Threads_connected"' Then: If connection limit reached, increase: mysql -e 'SET GLOBAL max_connections = 500' Then: Restart MySQL if crashed: sudo systemctl restart mysql Then: Verify VICIdial can connect: mysql -u cron -ptest asterisk -e 'SELECT COUNT(*) FROM vicidial_users LIMIT 1' Then: Restart VICIdial after database recovers

How can I prevent the "Database Connection Lost" error in VICIdial? +

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

Asterisk Not Running View error → VICIdial Process Not Running View error → Report Timeout View error →

Part of the Complete VICIdial Implementation Guide

Need Help Fixing This Error?

Our VICIdial experts can diagnose and resolve this issue quickly. Get a free performance audit and we'll identify all critical problems.

Get Your Free Audit →