J.K.A.
J.K.A.

Reputation: 7404

MySQL said: Documentation #2002 - The server is not responding + windows 8 + wampserver

I have wampserver 2.2, PHP 5.3.9, Mysql 5.0.8 and windows 8 as an operating system. I have installed wampsever recently and localhost is working fine with it but when I am trying to open phpadmin through wamp system tray icon it showing the following error :

Error

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

I am searching from last couple of days in google to resolve this issue but not getting any solution. Following is my config.inc.php file

<?php

/* Servers configuration */
$i = 0;

/* Server: localhost [1] */
$i++;
$cfg['Servers'][$i]['verbose'] = 'localhost';
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['socket'] = '/tmp/mysql.sock';
$cfg['Servers'][$i]['connect_type'] = 'socket';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'root';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['AllowNoPassword'] = true;

/* End of servers configuration */

$cfg['DefaultLang'] = 'en-utf-8';
$cfg['ServerDefault'] = 1;
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';


/* rajk - for blobstreaming */
$cfg['Servers'][$i]['bs_garbage_threshold'] = 50;
$cfg['Servers'][$i]['bs_repository_threshold'] = '32M';
$cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600;
$cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M';

?>

Need help for this. Thanks in advance.

Upvotes: 0

Views: 11800

Answers (5)

Aman Garg
Aman Garg

Reputation: 3290

You can follow the below to resolve the problem.

Step1: Go to the my.ini file and changed the setting for mysql socket = "MySQL" to "/tmp/mysql.sock".

Step2: Then do the same in the php ini file and restart the Web server whether it is WAMP or XAMP!

If you are using XAMP then you can try one more thing:

To fix the #2002 problem, open your config.inc.php with path: \xampp\phpMyAdmin at your XAMPP directory and add the following code:

$cfg['Servers'][$i]['socket'] = '/var/run/mysql/mysql.sock';
or
$cfg['Servers'][$i]['connect_type'] = 'tcp';

Hope using the above steps, you will get the solution. Please mark the answer resolved if it is relevant to solve the problem.

Upvotes: 1

Gowtham
Gowtham

Reputation: 12180

This applies to the same under Linux Debian based systems.

Probably this error will happen when you have mysql installed separately. Just remove it [if you don't need it] by the following commands and then you can use mysql via phpmyadmin. This worked for me:

sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean

Upvotes: 2

Chinnaiah S Vivek
Chinnaiah S Vivek

Reputation: 1

I have encounter the same problem and did the following to solve it:

  • Take the SETUP file in your pen drive
  • Uninstall completely the WAMP server from your computer with icon too
  • Then Restart the system then install the setup file whatever you have taken as backup in pendrive
  • Then launch by clicking next next next....
  • Then your WAMP is ready for your use

Upvotes: 0

HalfTitle
HalfTitle

Reputation: 147

"Error MySQL said:

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

This happened to me today, and it turned out to be simply that MySQL had not started, even though it's configured to start automatically. Search for Services, find MySQL in the list, and click on Start the service. (Don't ask me why this fault is suddenly happening).

Upvotes: 0

Yahia
Yahia

Reputation: 37

Did you run the setup script for the first time?, in order to allow access to local-server (specially in win 8) & make sure you always run it as admin.

If you have access to phpmyadmin you can do the above step from setting tab, in more setting option.

If you are having trouble setting this up, let me know and i will tell you more details about it.

This might be not the best answer for your questions, but i am trying to help as much as i can.

All right, Do the following steps , i assume that you have access to phpmyadmin, if not go to wamp directory -> alias -> open phpmyadmin.conf

Change the following code :

Order Deny,Allow
Deny from all
Allow from 127.0.0.1

To

Order Allow,Deny
Allow from all

Then save it.

Afterwards, Go to wamp tray icon -> right click -> put the server online

That should allow you to have access in both localhost and phpmyadmin

  • Instead of manually editing config.inc.php, you can use the Setup Script. First you must manually create a folder config in the phpMyAdmin directory (you can find it on wamp/apps/phpmyadmin/). This is a security measure and should be deleted after finishing the setupscript.
  • Then open localhost/phpmyadmin on your web browser
  • Go to settings tab
  • in more settings you will find link to SetupScript , should be in

    localhost/phpmyadmin/setup/index.php

  • under servers, hit new server

  • Type your host name which should be localhost since you are running on local machine
  • In Authentication Settings right the user and password to access phpmyadmin
  • There are a lot of other settings you may use depends on your needs
  • hit save button
  • Note that changes are not saved to disk until explicitly choose Save from the Configuration area of the screen. Normally the script saves the new config.inc.php to the config/ directory, but if the webserver does not have the proper permissions you may see the error "Cannot load or save configuration." Ensure that the config/ directory exists and has the proper permissions - or use the Download link to save the config file locally and upload (via FTP or some similar means) to the proper location.
  • Once the file has been saved, it must be moved out of the config/ directory to phpmyadmin main directory and the permissions must be reset, again as a security measure.
  • Now the file is ready to be used. You can choose to review or edit the file with your favorite editor, if you prefer to set some advanced options
  • If you are using the auth_type "config", it is suggested that you protect the phpMyAdmin installation directory because using config does not require a user to enter a password to access the phpMyAdmin installation. Use of an alternate authentication method is recommended, for example with HTTP–AUTH in a .htaccess file or switch to using auth_type cookie or http.
  • Open the main phpMyAdmin directory in your browser. phpMyAdmin should now display a welcome screen and your databases, or a login dialog if using HTTP or cookie authentication mode.
  • You should deny access to the ./libraries and ./setup/lib subfolders in your webserver configuration. For Apache you can use supplied .htaccess file in that folder, for other webservers, you should configure this yourself. Such configuration prevents from possible path exposure and cross side scripting vulnerabilities that might happen to be found in that code.
  • It is generally good idea to protect public phpMyAdmin installation against access by robots as they usually can not do anything good there. You can do this using robots.txt file in root of your webserver or limit access by web server configuration.

I hope that helps, if you need further information, Dont hesitate to ask :)

Upvotes: 3

Related Questions