Error with database connection in all the websites

harrel

Registered
Sep 12, 2011
2
0
51
cPanel Access Level
Root Administrator
Hello, I'm using a apache dedicated server with 8 GB ram, an a dual quad core CPU. Recently we just cleaned the /tmp directory. But the apache settings were not modified.

The sites were running fine, but then suddenly all the websites started showing error establishing database connection. All the wordpress, joomla and forums. The phpmyadmin is working fine from cPanel.

I restarted mySQL, it restarted successfully and then the websites weren't even loading.

Is it a problem with http.conf???

Is it caused by something else? How can I fix this problem? Please help.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
43
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
You likely destroyed the symlink in /tmp for mysql.sock file:

Code:
root@host [/tmp]# ls -lah mysql.sock
lrwxrwxrwx 1 root root 27 Aug 26 12:50 mysql.sock -> ../var/lib/mysql/mysql.sock=
Try to recreate the symlink:

Code:
ln -s /var/lib/mysql/mysql.sock mysql.sock
Then restart MySQL again.
 

harrel

Registered
Sep 12, 2011
2
0
51
cPanel Access Level
Root Administrator
Yep, I checked that. That wasn't the problem. The server was under SYN attack. After neutralizing the attack and after installling a cisco firewall, the problem went away.