【问题标题】:Xampp localhost/phpmyadmin errorXampp localhost/phpmyadmin 错误
【发布时间】:2012-06-26 07:19:33
【问题描述】:

每次我尝试访问我的 localhost/phpmyadmin 时都会出现此错误 ---> 错误 MySQL 说:

2002 - 服务器没有响应(或本地 MySQL 服务器的套接字配置不正确)

配置中定义的 controluser 连接失败。

我真的需要你的帮助,我一无所知。下面是我的 config.inc.php 文件 非常感谢您的帮助!

<?php
/*
* This is needed for cookie based authentication to encrypt password in
* cookie
*/
$cfg['blowfish_secret'] = 'xampp'; 

/*
*Servers configuration
*/
$i = 0;

/*
* First server
*/
$i++;

/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '**********'; 
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['AllowNoPassword'] = false;

/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = '';

/* Advanced phpMyAdmin features */
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
$cfg['Servers'][$i]['relation'] = 'pma_relation';
$cfg['Servers'][$i]['table_info'] = 'pma_table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma_column_info';
$cfg['Servers'][$i]['history'] = 'pma_history';
$cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
$cfg['Servers'][$i]['tracking'] = 'pma_tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma_userconfig';

/*
* End of servers configuration
*/

?>

【问题讨论】:

  • 你的服务器上运行的是Mysql服务吗?
  • 不,每次我启动它大约 3 秒后它就会停止。对我能做什么有什么建议吗?
  • phpMyAdmin 似乎没有问题,请检查您的 MySQL 日志 (xampp\mysql\data\mysql_error.log) 或尝试在命令行中运行 mysql.exe 并检查它的内容。
  • 由于某种原因,我在我的电脑上找不到 mysql.exe,我是不是要单独安装 mysql 和 xampp??

标签: php


【解决方案1】:

在 linux 系统上,您应该将以下内容添加到您的 config.inc.php

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

在windows系统上,

 $cfg['Servers'][$i]['socket'] = "c:/tmp/mysql.sock"

相同的更改也必须反映在您的 xampp\mysql\bin\my.ini 文件中。

【讨论】:

  • 你在my.ini文件中也改了吗?
  • 找不到my.ini文件,是不是在同一个目录下??
  • 您最好完全删除 XAMPP,包括已安装的目录,然后重新安装,而不是发现错误。确保没有其他 MySQL 实例在运行。
  • 好的,我试试看。请问如何检查是否有其他 MySQL 实例正在运行??
  • 它可能已经安装在过去并且处于休眠状态:) 只需检查您安装的程序和您的 Program Files 目录。
【解决方案2】:

来自Mysql documentation:
错误 (2002) Can't connect to ... 通常意味着系统上没有运行 MySQL 服务器,或者您在尝试连接到服务器时使用了不正确的 Unix 套接字文件名或 TCP/IP 端口号。您还应该检查您正在使用的 TCP/IP 端口是否未被防火墙或端口阻止服务阻止。

【讨论】:

    【解决方案3】:

    当我尝试打开 phpmyadmin 时,我也遇到了同样的错误,我从系统中删除了 mecafee,然后我重新启动了系统,从那时起它工作正常,可能是 mecafee(anit 病毒)是问题...希望它有效给你...

    【讨论】:

      猜你喜欢
      • 2020-10-15
      • 2015-11-13
      • 2012-07-22
      • 2015-04-08
      • 2013-01-01
      • 2014-09-05
      • 2016-02-14
      • 2016-07-06
      • 2017-06-21
      相关资源
      最近更新 更多