Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't start phpMyAdmin. Keep getting the #2002 socket error

I've been trying to set mysql and phpMyAdmin for the last 12 hours, without any success. And yes, after hours and hours of Google-ing I know that is a common problem and I've read similar queries on stackoverflow but still can't come with the solution.....

I've tried everything - from changing the

$cfg['Servers'][$i]['port']

in the config.inc.php file to 3306, 127.0.0.1....

typing the socket path in the config.inc.php file - both tmp/mysql.php and the /var/mysql/mysql.sock.

I've tried changing the socket path in the my.cnf file and the php.ini....but I keep getting the same error:

#2002 - No such file or directory
The server is not responding (or the local server's socket is not correctly configured).

I'm using MySQL (5.1.65), PhpMyAdmin (3.5.2.2) and PHP (5.3.8).

like image 312
Stella Antonova Avatar asked Aug 26 '12 22:08

Stella Antonova


People also ask

How do I fix phpMyAdmin not opening?

To access phpMyAdmin from XAMPP you will need to make sure you have Apache and MySQL running in the XAMPP control panel by clicking the start buttons under the Actions column. If Apache and MySQL are green then all is well. Then you can click the “Admin” button in the MySQL row and that will launch phpMyAdmin.

Why my localhost phpMyAdmin is not opening?

Try starting MySQL and Apache in Xampp. Verify Port Number assigned to Apache (By default it should be 80). Now load localhost/phpmyadmin . It solved my problem.

Why is phpMyAdmin not connecting?

phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

How do I access my localhost phpMyAdmin?

Once phpMyAdmin is installed point your browser to http://localhost/phpmyadmin to start using it. You should be able to login using any users you've setup in MySQL. If no users have been setup, use admin with no password to login.


2 Answers

I have recently encountered this problem on Mac OS Sierra too. Apache server is working but mysql is not. After searching for a solution, reading lots of posts I found this solution. And it worked!

The solution is to navigate to the mysql folder, in my case its,

/Applications/MAMP/db/mysql56/

and remove all the files except folders. Then restart MAMP again.

like image 113
natterstefan Avatar answered Sep 19 '22 08:09

natterstefan


  1. Quit MAMP
  2. Open the terminal
  3. Type: killall -9 mysqld Restart MAMP
like image 21
andrewoodleyjr Avatar answered Sep 19 '22 08:09

andrewoodleyjr