Mysql – How to Solve the XAMPP 1.7.7 – PHPMyAdmin – MySQL Error #2002 in Ubuntu


I have been through lots of forums and checked various posts on similar topic but non seems to work out for me.

I have freshly installed XAMPP 1.7.7 on my Ubuntu 11.10 Operating system. Everything is running except for the phpMyAdmin.

Upon hitting: http://localhost/phpmyadmin, I am getting the following error:

MySQL said:

#2002 - The server is not responding 
(or the local MySQL server's socket is not correctly configured) 

Connection for controluser as defined in your configuration failed.

When i am starting the services with: sudo /opt/lampp/lampp start
I am getting the following:

XAMPP: Another web server daemon is already running.
XAMPP: Another MySQL daemon is already running.
XAMPP: Another FTP daemon is already running.
XAMPP for Linux

Any suggestions would be greatly appreciated.

Best Solution

It turns out that the solution is to stop all the related services and solve the “Another daemon is already running” issue.

The commands i used to solve the issue are as follows:

sudo /opt/lampp/lampp stop              
sudo /etc/init.d/apache2 stop    
sudo /etc/init.d/mysql stop

Or, you can also type instead:

sudo service apache2 stop
sudo service mysql stop

After that, we again start the lampp services:

sudo /opt/lampp/lampp start

Now, there must be no problems while opening: