13

我正在运行一个应用程序localhost,它已经成功运行了至少一年,但是今天突然 wampserver 没有启动。每当我右键单击任务栏图标并“启动所有服务”时,它会变为橙色,但不会变为绿色。昨天有一个数据丢失问题,因为其中一个 mysql 表崩溃并且必须修复,如果这与此有关的话。

如果我尝试http://localhost/phpmyadmin,我会收到一个403 Forbidden错误,这是我以前从未遇到过的。

我今天检查了 apache 日志,它的最新条目是:

[Sat Jul 20 14:17:31 2013] [error] [client 127.0.0.1] PHP Stack trace:, referer: http://localhost/zeejflow/index.php
[Sat Jul 20 14:17:31 2013] [error] [client 127.0.0.1] PHP   1. {main}() D:\\wamp\\www\\zeejflow\\index_exe.php:0, referer: http://localhost/zeejflow/index.php
[Sat Jul 20 14:17:31 2013] [error] [client 127.0.0.1] PHP   2. mysql_real_escape_string() D:\\wamp\\www\\zeejflow\\index_exe.php:25, referer: http://localhost/zeejflow/index.php
[Sat Jul 20 14:17:31 2013] [error] [client 127.0.0.1] PHP Warning:  mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: A link to the server could not be established in D:\\wamp\\www\\zeejflow\\index_exe.php on line 25, referer: http://localhost/zeejflow/index.php
[Sat Jul 20 14:17:31 2013] [error] [client 127.0.0.1] PHP Stack trace:, referer: http://localhost/zeejflow/index.php
[Sat Jul 20 14:17:31 2013] [error] [client 127.0.0.1] PHP   1. {main}() D:\\wamp\\www\\zeejflow\\index_exe.php:0, referer: http://localhost/zeejflow/index.php
[Sat Jul 20 14:17:31 2013] [error] [client 127.0.0.1] PHP   2. mysql_real_escape_string() D:\\wamp\\www\\zeejflow\\index_exe.php:25, referer: http://localhost/zeejflow/index.php
[Sat Jul 20 14:17:32 2013] [error] [client 127.0.0.1] PHP Warning:  mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: [2002] No connection could be made because the target machine actively  (trying to connect via tcp://localhost:3306) in D:\\wamp\\www\\zeejflow\\index_exe.php on line 26, referer: http://localhost/zeejflow/index.php
[Sat Jul 20 14:17:32 2013] [error] [client 127.0.0.1] PHP Stack trace:, referer: http://localhost/zeejflow/index.php
[Sat Jul 20 14:17:32 2013] [error] [client 127.0.0.1] PHP   1. {main}() D:\\wamp\\www\\zeejflow\\index_exe.php:0, referer: http://localhost/zeejflow/index.php
[Sat Jul 20 14:17:32 2013] [error] [client 127.0.0.1] PHP   2. mysql_real_escape_string() D:\\wamp\\www\\zeejflow\\index_exe.php:26, referer: http://localhost/zeejflow/index.php
[Sat Jul 20 14:17:32 2013] [error] [client 127.0.0.1] PHP Warning:  mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: No connection could be made because the target machine actively refused it.\r\n in D:\\wamp\\www\\zeejflow\\index_exe.php on line 26, referer: http://localhost/zeejflow/index.php
[Sat Jul 20 14:17:32 2013] [error] [client 127.0.0.1] PHP Stack trace:, referer: http://localhost/zeejflow/index.php
[Sat Jul 20 14:17:32 2013] [error] [client 127.0.0.1] PHP   1. {main}() D:\\wamp\\www\\zeejflow\\index_exe.php:0, referer: http://localhost/zeejflow/index.php
[Sat Jul 20 14:17:32 2013] [error] [client 127.0.0.1] PHP   2. mysql_real_escape_string() D:\\wamp\\www\\zeejflow\\index_exe.php:26, referer: http://localhost/zeejflow/index.php
[Sat Jul 20 14:17:32 2013] [error] [client 127.0.0.1] PHP Warning:  mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: A link to the server could not be established in D:\\wamp\\www\\zeejflow\\index_exe.php on line 26, referer: http://localhost/zeejflow/index.php
[Sat Jul 20 14:17:32 2013] [error] [client 127.0.0.1] PHP Stack trace:, referer: http://localhost/zeejflow/index.php
[Sat Jul 20 14:17:32 2013] [error] [client 127.0.0.1] PHP   1. {main}() D:\\wamp\\www\\zeejflow\\index_exe.php:0, referer: http://localhost/zeejflow/index.php
[Sat Jul 20 14:17:32 2013] [error] [client 127.0.0.1] PHP   2. mysql_real_escape_string() D:\\wamp\\www\\zeejflow\\index_exe.php:26, referer: http://localhost/zeejflow/index.php
[Sat Jul 20 14:17:33 2013] [error] [client 127.0.0.1] PHP Warning:  mysql_num_rows() expects parameter 1 to be resource, integer given in D:\\wamp\\www\\zeejflow\\index_exe.php on line 34, referer: http://localhost/zeejflow/index.php
[Sat Jul 20 14:17:33 2013] [error] [client 127.0.0.1] PHP Stack trace:, referer: http://localhost/zeejflow/index.php
[Sat Jul 20 14:17:33 2013] [error] [client 127.0.0.1] PHP   1. {main}() D:\\wamp\\www\\zeejflow\\index_exe.php:0, referer: http://localhost/zeejflow/index.php
[Sat Jul 20 14:17:33 2013] [error] [client 127.0.0.1] PHP   2. mysql_num_rows() D:\\wamp\\www\\zeejflow\\index_exe.php:34, referer: http://localhost/zeejflow/index.php
[Sat Jul 20 14:17:33 2013] [error] an unknown filter was not added: DEFLATE
[Sat Jul 20 14:17:33 2013] [error] an unknown filter was not added: DEFLATE
[Sat Jul 20 14:17:33 2013] [error] an unknown filter was not added: DEFLATE

index_exe.php 上的第 25 和 26 行如下所示(我试图登录到应用程序):

$userName = mysql_real_escape_string($_POST['userName']);
$Password = mysql_real_escape_string($_POST['Password']);

由于该[2002] No connection could be made because the target machine actively (trying to connect via tcp://localhost:3306错误,我认为使用相同端口的其他应用程序可能存在问题,因此我尝试了以下操作(我的 wamp 在 D 上运行:):

C:\Users\admin>netstat

Active Connections

  Proto  Local Address          Foreign Address        State
  TCP    127.0.0.1:5939         localhost127:49313     ESTABLISHED
  TCP    127.0.0.1:5939         localhost127:49317     ESTABLISHED
  TCP    127.0.0.1:49155        localhost127:49156     ESTABLISHED
  TCP    127.0.0.1:49156        localhost127:49155     ESTABLISHED
  TCP    127.0.0.1:49157        localhost127:49158     ESTABLISHED
  TCP    127.0.0.1:49158        localhost127:49157     ESTABLISHED
  TCP    127.0.0.1:49311        localhost127:49312     ESTABLISHED
  TCP    127.0.0.1:49312        localhost127:49311     ESTABLISHED
  TCP    127.0.0.1:49313        localhost127:5939      ESTABLISHED
  TCP    127.0.0.1:49315        localhost127:49316     ESTABLISHED
  TCP    127.0.0.1:49316        localhost127:49315     ESTABLISHED
  TCP    127.0.0.1:49317        localhost127:5939      ESTABLISHED
  TCP    127.0.0.1:49320        localhost127:49321     ESTABLISHED
  TCP    127.0.0.1:49321        localhost127:49320     ESTABLISHED
  TCP    192.168.15.200:49166   server6201:5938        ESTABLISHED
  TCP    192.168.15.200:49847   Server-PC:netbios-ssn  TIME_WAIT
  TCP    192.168.15.200:49848   Server-PC:netbios-ssn  TIME_WAIT

D:\>netstat

Active Connections

  Proto  Local Address          Foreign Address        State
  TCP    127.0.0.1:80           localhost127:49799     TIME_WAIT
  TCP    127.0.0.1:80           localhost127:49800     TIME_WAIT
  TCP    127.0.0.1:80           localhost127:49801     TIME_WAIT
  TCP    127.0.0.1:80           localhost127:49802     TIME_WAIT
  TCP    127.0.0.1:80           localhost127:49803     TIME_WAIT
  TCP    127.0.0.1:80           localhost127:49804     TIME_WAIT
  TCP    127.0.0.1:80           localhost127:49806     TIME_WAIT
  TCP    127.0.0.1:80           localhost127:49810     TIME_WAIT
  TCP    127.0.0.1:80           localhost127:49811     TIME_WAIT
  TCP    127.0.0.1:5939         localhost127:49313     ESTABLISHED
  TCP    127.0.0.1:5939         localhost127:49317     ESTABLISHED
  TCP    127.0.0.1:49155        localhost127:49156     ESTABLISHED
  TCP    127.0.0.1:49156        localhost127:49155     ESTABLISHED
  TCP    127.0.0.1:49157        localhost127:49158     ESTABLISHED
  TCP    127.0.0.1:49158        localhost127:49157     ESTABLISHED
  TCP    127.0.0.1:49311        localhost127:49312     ESTABLISHED
  TCP    127.0.0.1:49312        localhost127:49311     ESTABLISHED
  TCP    127.0.0.1:49313        localhost127:5939      ESTABLISHED
  TCP    127.0.0.1:49315        localhost127:49316     ESTABLISHED
  TCP    127.0.0.1:49316        localhost127:49315     ESTABLISHED
  TCP    127.0.0.1:49317        localhost127:5939      ESTABLISHED
  TCP    127.0.0.1:49320        localhost127:49321     ESTABLISHED
  TCP    127.0.0.1:49321        localhost127:49320     ESTABLISHED
  TCP    192.168.15.200:49166   server6201:5938        ESTABLISHED
  TCP    192.168.15.200:49805   mrs02s05-in-f4:http    ESTABLISHED

但现在我不知道该怎么做。我确保 my.ini 指定了端口 3306,并且它已经指定了(无论如何一年内没有人更改它,它怎么会突然有另一个值)。请提供任何帮助!我认为 Apache 正在工作,因为当我输入时http://localhost,它可以工作并提供转到 phpmyadmin 或我的应用程序文件夹的选项,但似乎 mysql 服务没有启动或什么?我向管理员确认,没有安装任何新软件(例如 Skype)或任何东西。

更新

我去Services.mscwampapache了一下,状态是“开始”。但wampmysqld没有地位。所以我右键单击并选择“开始”。一条消息说“Windows 正在尝试在本地计算机上启动服务”,但后来我收到了这个错误:

Windows could not start the wampmysqld service on Local Computer
Error 1067: The process terminated unexpectedly

到底是怎么回事?:(

更新 2

我让mysql再次工作,在这里:

mysqld 工作但 wampmysqld 没有启动

但是,localhost://phpmyadmin仍然给我一个403 forbidden错误,并mysql_connect不断给我一个“拒绝访问”错误。

4

25 回答 25

14

转到:wamp\bin\mysql\mysql5.6.17\data并删除以下内容:

auto.cnf, xxxxxxxxx.err,和xxxxxxxxx.pid_ib_logfile0ib_logfile1

保持其他文件不变。

如果是Skype占用了您的80端口,请转到Skype:工具>选项并提前>连接取消选中“使用端口80和443......”

于 2015-12-22T11:08:31.700 回答
13

今天发生在我身上。由于自昨天以来我没有更改我的系统设置,我认为这主要是系统上的 mysql 问题。我设法通过以下方式修复它。

  1. 打开 wampserver 的 mysql 日志文件。这将包含有关服务抛出和错误以及过早退出的原因的信息。

  2. 就我而言,mysql 服务无法启动,因为它无法读取某个表空间。日志中指出了具体的表空间。

  3. 未能读取此类文件可能是因为文件权限或文件被破坏。在这种情况下,mysql 会停止执行以避免损坏可能链接到您需要的数据库的表空间文件。通常,如果您有数据库的备份,那么只需删除这个有问题的文件并在您的 mysql 服务再次启动后恢复数据库是安全的。

  4. 如果您没有数据库备份,那么您可以通过启用 my.cnf / my.ini 文件中的选项来强制 mysql 实例运行恢复。

innodb_force_recovery = 1

这会强制实例运行崩溃恢复。

注意:安装一个新的 mysql 实例并不一定意味着您的数据库应该被保留。如果您正在处理大型项目,我建议您每晚运行一次数据库备份。

于 2013-10-04T07:15:49.770 回答
8

我有同样的问题,为了解决它,我在 my.ini 中添加了以下行

innodb_force_recovery = 1
于 2015-03-04T14:02:59.623 回答
5

我运行 Wamp Server 一年多了,
现在我遇到了无法启动 Wamp Server 的问题(图标一直保持红色并出现错误消息)

我设法卸载 Wamp 并再次重新安装它,所以我做到了,但在此之前我将文件夹从 mysql/data 复制到我的桌面,然后当我重新安装它时,我将该文件复制到原始位置。

然后mysql就搞糊涂了...而且phpmyadmin无法正常工作,所以我通过恢复新安装文件夹的内容来解决这个问题..
但我无法启动mysql(wamp服务器图标仍为黄色)

所以在我搜索了很多之后,我删除了 mysql/data 中的所有内容,除了:-

mysql
test
performance_schema

我的问题解决了:)

于 2014-12-19T01:13:03.607 回答
4

我有同样的问题......

WampServer 自 2 月以来一直在我的本地开发服务器上运行良好。今天我无法让它运行。

转到谷歌,在那里我找到了这个页面并没有找到答案,直到我看到最后一个条目:

“1.运行WampServer:Apache->服务->测试80端口。

2.找出占用80端口的应用程序(例如Skype)”

确实如此,它返回 Skype 可能阻塞了端口 80。

关闭Skype,问题就解决了。

于 2014-04-28T23:33:49.603 回答
2

我有同样的问题。Mysql 没有启动。

  1. 去服务。
  2. 右键单击 wampmysqld 转到属性。
  3. 启动类型选择手动。
  4. 右键单击并单击启动服务。

为我工作。

于 2014-10-23T08:14:30.640 回答
2

- 转到任务管理器 - 结束 mysql 的所有任务实例 - 重新启动你的 wampserver

于 2020-05-14T13:54:23.517 回答
1

对我来说,将innodb_force_recovery=3添加到my.ini解决了这个问题

另一种选择是从数据目录中删除ibdata文件和所有ib_logfile ,如MySQL docs here中所述。但是,这将导致任何 innoDB 表无法工作(因为存储在ibdata1中的一些信息)

于 2015-02-17T03:42:14.157 回答
1

您可能想从 MySQL 重置数据

  • 从 C:\wamp\bin\mysql\mysql5.6.17\data 中删除以前的数据
  • 重启服务
于 2015-07-04T10:31:39.540 回答
0

从此文件中删除所有内容。

C:\wamp\bin\mysql\mysql5.1.36\data\mysql-bin.index

重新启动mysql服务器,它应该可以工作。

于 2014-01-28T08:18:45.193 回答
0

我从命令提示符打开了 services.msc 并禁用了SQL Server 报告服务

& SQL Server 分析服务。这些服务使用端口 80。

然后我重新启动了 WAMP 服务器,它开始像以前一样正常工作。

于 2014-05-21T11:44:48.577 回答
0

我已经完全卸载了 WampServer,并删除了 /wamp 文件夹中的所有文件,除了 www. 卸载时会保留此文件夹。之后我再次安装它,它工作正常。

重要提示:这仅在您已经备份数据库的情况下才有用。数据库中的所有数据都将以这种方式清除。

于 2014-05-24T22:00:44.433 回答
0
  1. 运行 WampServer:Apache->service->test 80 端口。

  2. 找出占用80端口的应用程序(例如Skype)

  3. 关闭并重新启动 WampServer。

于 2014-02-26T03:35:18.477 回答
0

从此文件中删除所有内容。

C:\wamp\bin\mysql\mysql5.1.36\data\mysql-bin.index

这个对我有用。我的 wamp 服务器变绿了。Tnx 很多

于 2015-06-10T04:27:56.977 回答
0
  1. 单击 wamp(黄色)图标

  2. 转到 Apache-> 服务-> 测试端口 80。如果端口可用,则转到 Apache-> 服务-> 安装服务

  3. 然后单击重新启动所有服务。

于 2015-11-01T11:33:28.917 回答
0

您是否尝试过仅更改 MySQL 的端口号并查看它是否有效?

  1. 右键单击您的 WAMP 图标

  2. 选择 MySQL,在菜单中选择“使用 3306 以外的端口”

  3. 将端口号更改为“3307”

于 2016-05-07T10:06:31.030 回答
0

哇..这对我有用。卸载 wamp 服务器确保已成功安装此依赖项Microsoft Visual C++ Redistributable Packages vcredist_Allversions(x32 orx64),具体取决于您的操作系统。重新安装 wamp 服务器,一切顺利。谢谢

于 2019-12-20T08:52:05.370 回答
0

我在同样的问题上运行,wampmysqld64 没有启动,所以我检查了 Mysql 日志,你应该在 wamp64 主文件夹中找到它,我找到了为什么不工作的所有细节。在我的计算机上,我发现另一个 mysql 实例正在运行,因此它阻止了 wampmysqld64 启动。我停止了另一个实例,之后一切正常。

于 2016-12-01T04:36:58.347 回答
0

我的问题是 wampmysqld64 服务被禁用了,所以我去了:任务管理器>服务>右键单击 wampmysqld64 然后属性,另一个窗口将打开,查找 wampmysqld64 服务然后右键单击然后单击属性,然后会出现一个窗口弹出:

wampmysqld64 属性窗口

在“启动类型”上,只需将其从禁用更改为自动,然后返回单击服务并运行它,这就是它的 wamp 徽标,它会变成绿色。

于 2020-10-28T19:39:38.347 回答
0

基本上,当您在安装 Wampserver 时没有在您的机器上安装预先需要的软件时,就会发生这种情况,您在安装时可能会遇到以下错误。

program can't start because msvcr120.dll is missing OR

program can't start because msvcr120.dll is missing

如果您在安装 wampserver 后解决了这些问题,那么您可能会遇到此问题。

然后您可以简单地再次卸载并安装 wamp 服务器

如果您还没有安装预先需要的依赖项,那么首先卸载 wampserver 。然后先安装前置要求,最后你可以安装 Wampserver,它现在应该可以工作了。

您可以从以下链接下载必备应用程序

对于 x64 机器

microsoft visual c++ 2010 可再发行包 (x64) https://www.microsoft.com/en-in/download/details.aspx?id=14632

Visual C++ Redistributable for Visual Studio 2012 Update 4 https://www.microsoft.com/en-in/download/details.aspx?id=30679

适用于 Visual Studio 2013 的 Visual C++ 可再发行包https://www.microsoft.com/en-in/download/details.aspx?id=40784

Visual C++ Redistributable for Visual Studio 2015 https://www.microsoft.com/en-in/download/details.aspx?id=48145

对于 x86 机器

Microsoft Visual C++ 2010 可再发行包 (x86) https://www.microsoft.com/en-in/download/details.aspx?id=14632

Visual C++ Redistributable for Visual Studio 2012 Update 4 https://www.microsoft.com/en-in/download/details.aspx?id=30679

适用于 Visual Studio 2013 的 Visual C++ 可再发行包https://www.microsoft.com/en-in/download/details.aspx?id=40784

Visual C++ Redistributable for Visual Studio 2015 https://www.microsoft.com/en-in/download/details.aspx?id=48145

注意:- 在卸载之前备份您的项目文件

于 2020-10-17T07:21:17.540 回答
0

单击 wampserver 图标,然后 -> Apache -> httpd.conf -> 在此处搜索侦听,您将找到像这样的端口号#Listen 12.34.56.78:80 Listen 80 将这个端口号更改为任何其他数字,例如Listen 12.34.56.78:81保存这个,然后重新启动所有服务器,它会从绿色变为橙色。

于 2018-06-23T07:26:16.467 回答
0

在过去的 3 天里,我有同样的问题。尝试这个。它肯定会奏效。在继续安装 Wampserver 之前,您必须确保在您的系统上安装了某些元素,否则 Wampserver 将绝对无法运行,此外,安装将出现错误,您需要在安装缺少的元素之前删除 Wampserver . 卸载 wamp 并下载并安装 microsoft visual c++ redistributable 2008 ( https://www.microsoft.com/en-in/download/details.aspx?id=29 )、microsoft visual c++ redistributable 2012 ( https://www.microsoft .com/en-in/download/details.aspx?id=30679),microsoft visual c++ redistributable 2015(https://www.microsoft.com/en-in/download/details.aspx?id=48145)。现在,重新安装 wamp,它应该可以正常工作。

于 2019-01-12T06:39:36.380 回答
0

我遇到了一个非常相似的问题,在尝试了很多甚至在这个问题中的解决方案之后,我以THIS OTHER ANSWER得出结论。

我没有在这里复制它,因为它不是正确的做法。

基本上是关于重新安装 MySQL(或整个包),确保很好地删除旧的 my-sql-data(如果需要,请备份它)并坚持使用 32 位版本。

于 2016-06-10T16:19:28.140 回答
0

我通过以下步骤解决了我的问题:

  • 在 Windows 平台上按 WINDOWS + R
  • 放入 services.msc 并按 OK
  • 停止已经运行 MySQL 和
  • 转到 Wamp 并启动​​/恢复 MySQL 服务

一切顺利

于 2017-08-23T06:18:52.990 回答
0

最简单的做法是查找其他服务正在使用与 Windows 中的 mysql 相同的服务 ID。

当我查看我的电脑上运行的服务列表时(即使重新启动......我仍然有问题)

我很快意识到我在 wamp 服务器之前的计算机上安装了 webmatrix...webmatrix 安装了自己的 mysql 副本,并将其设置为每次登录时自动启动另一个实例。

一旦与 web 矩阵关联的另一个 mysql 实例停止(并从自动启动更改为手动),我的 WAMP mysql 问题就解决了。

于 2016-10-06T05:21:25.883 回答