dongxie3701 2013-02-08 10:06
浏览 64

MySQL说:文档#2002 - 服务器没有响应+ 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.

  • 写回答

5条回答 默认 最新

  • duanjian5059 2013-02-08 10:15
    关注

    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 :)

    评论

报告相同问题?

悬赏问题

  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号