MySQL server down: ERROR 2002 (HY000)


  • All Joomla websites hosted on single virtual server are down.
  • Trying to access any of the sites, web browsers display following errors:
    Infinite loop detected in JError

    Database Error: Unable to connect to the database:Could not connect to MySQL
  • phpMyAdmin web interface displays login screen would not allow to login (simply reloads the page after submitting credentials).
  • Trying to connect to MySQL via console fails with errors:
    ERROR 1040 (hy000): Too many connections
    ERROR 2002   (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Unlock network files locked by Samba Linux / Unix Server

Samba is a free Linux/Unix software which provides file and print access for Microsoft Windows clients. If you have a Linux file server or Linux based NAS device on a network with Windows clients you are probably using Samba.

Samba deals with file locking, preventing file corruption and data loss when two or more clients try to simultaneously edit the same file. There may be situations where you need to force file unlock, for example when file was closed but lock was not properly released by Samba.

Unfortunately Samba doesn't allow unlocking individual files. There are couple of workarounds though.

Installing LDAP support in PHP on Ubuntu LAMP server

LDAP support in PHP is not enabled by default. To enable LDAP support on an existing Ubuntu Apache web server you need to install php5-ldap package.
Install php5-lda:
sudo apt-get install php5-ldap
Reboot apache
/etc/init.d/apache2 restart

Install network traffic monitoring utility vnStat on Ubuntu server

vnStat is a console based network traffic monitoring utility for Linux which collects bandwidth statistic for selected interface(s).
Network traffic monitoring utility vnStat

To install vnStat run:
sudo apt-get install vnstat

To create and configure database run:
sudo vnstat -u -i eth0
Note 1: This assumes that you want to monitor eth0 interface. To find all your active interfaces run ifconfig.
Note 2: Some manuals state that above command should create a cron job. This was the case with older vnStat 1.6 version. Current vnStat 1.10 version uses daemon therefore cron job is not created. To check your vnStat version run: sudo vnstat -v

To start monitoring daemon run:
sudo service vnstat start

To display collected statistics run:
vnstat -q
Note: it may take couple of minutes after starting the service for vnStat to display statistics.

To display transfer rates in real time run:
vnstat -l

To view all options run
vnstat -?

Ubuntu server 10.10


Subscribe to receive occasional updates on new posts.
Your email will not be used for any other purpose and you can unsubscribe at any time.
Please wait