Windows 7 上的 XAMPP 无法正常工作

发布于 2024-09-03 16:29:55 字数 517 浏览 8 评论 0原文

我刚刚在 Windows 7 上安装了 XAMPP lite。我有两个驱动器 - C: 用于操作系统和常规文件,以及外部驱动器 E:。我在 E:(根目录)上安装了 XAMPP lite,但它一直给我带来问题。 Apache 工作得很好,但 MySQL 却不能工作。当我转到 http://localhost/phpmyadmin/ 时,它给了我以下错误:

Error

MySQL said: 
#2003 - Can't connect to MySQL server on 'localhost' (10061)
Connection for controluser as defined in your configuration failed.

关于什么的任何想法可能是问题所在?我使用了 XAMPP lite(32 位版本)的 zip 文件。这是 Windows 7 家庭高级版。

谢谢!

I just installed XAMPP lite on Windows 7. I have two drives - C: for the OS and regular files, and an external drive E:. I installed XAMPP lite on E: (on the root), and its been giving me problems. Apache works well enough, but MySQL doesn't work. When I go to http://localhost/phpmyadmin/, it gives me the following error:

Error

MySQL said: 
#2003 - Can't connect to MySQL server on 'localhost' (10061)
Connection for controluser as defined in your configuration failed.

Any ideas as to what could be the problem? I used the zip file for XAMPP lite, the 32 bit version. This is on Windows 7 Home premium.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

苍风燃霜 2024-09-10 16:29:56

今天发生在我身上,这是因为 Dropbox.exe 使用端口 3306。如果您从 XAMPP 控制面板运行端口检查,您将能够查看是否存在任何冲突的端口问题。

This happened to me today, and it was because Dropbox.exe was using port 3306. If you run the Port-Check from XAMPP control panel, you will be able to see if there are any conflicting port issues.

风吹雪碎 2024-09-10 16:29:56

您需要实际启动 MySQL 数据库服务器。

启动 XAMPP 控制面板,然后单击 MySQL 右侧的“开始”按钮。
(或者运行“mysql_start”批处理文件)

You need to actually start the MySQL database server.

Start the XAMPP Control Panel and click the "Start" button just to the right of where it says MySQL.
(Or run the "mysql_start" batch file)

牛↙奶布丁 2024-09-10 16:29:56

请编辑 xampp 安装内 phpmyadmin 子文件夹中的 config.inc.php 文件,并为 $cfg['Servers'][$i]['host' 指定“127.0.0.1”(而不是“localhost”等任何其他值) ] 设置如下:

$cfg['Servers'][$i]['host'] = '127.0.0.1'; 

然后尝试使用:

http://127.0.0.1/phpmyadmin

它应该可以工作(在至少它对我有用并且我遇到了完全相同的问题)。

如果这不起作用,您可以尝试此处描述的解决方案:

http ://forums.mysql.com/read.php?35,64808,254785#msg-254785

或:

您可以将上述设置保留为:

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

并编辑 %windir%\ system32\drivers\etc\hosts 添加该行(如果尚不存在):

127.0.0.1       localhost

请注意: 我正在使用 xampp beta,您可以在这里找到:http://www.apachefriends.org/en/xampp-beta.html

编辑:
最近我发现了这个链接 http://www.ihostnz。 com/howto-install-xampp-windows-7-xdebug-netbeans,按照那里的说明进行操作,现在一切都变得轻而易举。

Please edit your config.inc.php file in phpmyadmin subfolder inside xampp's installation, and specify '127.0.0.1' (instead of any other value like 'localhost) for the $cfg['Servers'][$i]['host'] setting as follows:

$cfg['Servers'][$i]['host'] = '127.0.0.1'; 

Then try with:

http://127.0.0.1/phpmyadmin

and it should work (at least it worked for me and I had exactly the same problem).

If this doesn't work you can try solutions described here:

http://forums.mysql.com/read.php?35,64808,254785#msg-254785

OR:

you can leava the setting mentioned above as:

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

and edit %windir%\system32\drivers\etc\hosts adding the line (if it doesn't already exist):

127.0.0.1       localhost

Please note: I am using xampp beta which you can find here: http://www.apachefriends.org/en/xampp-beta.html

EDIT:
Recently I have found this link http://www.ihostnz.com/howto-install-xampp-windows-7-xdebug-netbeans, followed the instructions there and now everything works like a breeze.

最单纯的乌龟 2024-09-10 16:29:56

有时我会收到此错误:

ERROR: MySql service not started [-1]

在开发人员的计算机(基于 Windows)上安装 XAMPP 时,因为通常开发人员已经在其计算机上安装了 MySql。 MySql 将自身安装为服务,默认名称为“MySql”; XAMPP 也将这个名称用于他自己的 MySql,这会让人感到困惑。 所以,我的解决方案是

  • 删除现有的“MySql”服务,即由MySql安装程序创建的服务;
  • 重新添加并使用新名称(不是“MySql”)
  • 愉快地使用 XAMPP :)

这是一篇更通用的文章(意大利语,但您应该弄清楚):
XAMPP: cosa fare quando qualche servizio 非一方(Windows)

Sometimes I get this error:

ERROR: MySql service not started [-1]

when installing XAMPP on developers' machines (Windows-based), because often developers already have a MySql installation on their computers. MySql installs itself as service with the default name "MySql"; XAMPP uses this name too for his own MySql, it gets confused. So, my solution is:

  • remove existing "MySql" service, the one created by the MySql installer;
  • re-add it with a new name (not "MySql")
  • use XAMPP happily :)

Here is a more general article (in italian language, but you should figure it out):
XAMPP: cosa fare quando qualche servizio non parte (Windows)

残花月 2024-09-10 16:29:56

只需转到 xampp 文件夹,然后转到 phpmyadmin 文件夹。在这里你会看到一个 user_password.php 文件。只需将密码设为空即可

just go to the xampp folder then phpmyadmin folder. here u will see a user_password.php file. just make the password null

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文