Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Any suggestions would be greatly appreciated.

like image 441
CompilingCyborg Avatar asked May 03 '12 06:05

CompilingCyborg


People also ask

Why phpMyAdmin is not working in XAMPP?

I solved this problem by changing the proxy of my firefox browser, go to menu tools-Option find tab Network, click button settings. Fill the text box below No Proxy for with localhost. Then press Ok, then Ok again. Try now typing localhost/xampp then it should show Welcome to XAMPP for Windows!

Why XAMPP is not working MySQL?

Fixing the MySQL server not starting in XAMPP is done by reverting back the data files pre-issue. Navigate to your XAMPP MySQL directory ( C:\xampp\mysql ). Create a new folder called FIX_BACKUP . Copy C:\xampp\mysql\backup and C:\xampp\mysql\data into C:\xampp\mysql\FIX_BACKUP .

Why does phpMyAdmin show error?

A database connection error means that your phpMyAdmin tool is not able to connect to the MySQL database. Usually, this is because the MAMP phpMyAdmin configuration file has the incorrect settings.


7 Answers

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:

http://localhost                  
http://localhost/phpmyadmin
like image 149
CompilingCyborg Avatar answered Sep 28 '22 11:09

CompilingCyborg


  1. Open config.default.php file under phpmyadmin/libraries/
  2. Find $cfg['Servers'][$i]['host'] = 'localhost'; Change to $cfg['Servers'][$i]['host'] = '127.0.0.1';
  3. refresh your phpmyadmin page, login
like image 22
brucenan Avatar answered Sep 28 '22 12:09

brucenan


At each point in these instructions, check to see if the problem is fixed. If so, great! Otherwise, continue.

  1. Get to Services. (I was able to right click the Apache launch icon to get there.)
  2. Scroll down to MySQL. Click to start. This will get rid of the #2002 error. Now you'll have a new error:

#1045 - Access denied for user 'root'@'localhost' (using password: NO)

  1. Edit the C:\wamp\apps\phpmyadmin3.5.1\config.inc.php file, changing $cfg['Servers'][$i]['extension'] = 'mysqli'; to instead be= 'mysql'
  2. Open Services again and Stop MySQL
  3. While in Services, Start wampmysqld

This is convoluted, I know, but that's what worked for me. Some posts may say you need a password in the config file, but you don't. Mine is still ""

Hope this helps.

like image 25
Michele Avatar answered Sep 28 '22 11:09

Michele


The problem might be with service mysql-server and apache2 running while system start. You can do the following.

sudo /opt/lampp/lampp stop

To stop already running default services

sudo service apache2 stop
sudo service mysql  stop

To remove the services completely, so that they won't create problem in next system-restart, If you are in ubuntu(debian)

sudo apt-get remove apache2
sudo apt-get remove mysql-server

If you are in redhat or other, You could use yum or similar command to uninstall the services

Then start the lampp again

sudo /opt/lampp/lampp start

Also, don't install mysql-server in the system, because it might start in system start-up, occupy the port, and create problem for mysql of lampp.

like image 40
Rajan Avatar answered Sep 28 '22 13:09

Rajan


I stopped MySQL sudo service mysql stop and then started xammp sudo /opt/lampp/lampp start and it worked!

like image 44
Snaily Avatar answered Sep 28 '22 11:09

Snaily


Go to phpMyAdmin/config.inc.php edit the line

$cfg['Servers'][$i]['password'] = '';

to

$cfg['Servers'][$i]['password'] = 'yourpassword';

This problem might occur due to setting of a password to root, thus phpmyadmin is not able to connect to the mysql database.

And the last thing change

$cfg['Servers'][$i]['extension'] = 'mysql';

to

$cfg['Servers'][$i]['extension'] = 'mysqli';

Now restart your server. and see.

like image 21
Hemanta Nandi Avatar answered Sep 28 '22 12:09

Hemanta Nandi


Go to config.inc.php file using terminal by typing the following:

sudo gedit /opt/lampp/phpmyadmin/config.inc.php

The file will open in gedit.

Now open the file and edit

$cfg['Servers'][$i]['auth_type'] = 'localhost';

to

$cfg['Servers'][$i]['auth_type'] = 'cookie';

and keep the username as: root password:

Also make sure that the lines with username and password are not commented:

//$cfg['Servers'][$i]['user'] = 'root'; //$cfg['Servers'][$i]['password'] = '';

Make sure that // is removed from the above lines.

like image 34
Pragya Avatar answered Sep 28 '22 11:09

Pragya