Wampserver 图标没有完全变绿,mysql 服务没有启动?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17761931/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Wampserver icon not going green fully, mysql services not starting up?
提问by user961627
I'm running an application on localhost
, it's been running successfully for at least a year now, but suddenly today wampserver isn't starting up. Whenever I rightclick on the taskbar icon and "start all services", it gets orange, but never green. Yesterday there was a data loss problem because one of the mysql tables crashed and had to be repaired, if that's related to this in any way.
我正在运行一个应用程序localhost
,它已经成功运行了至少一年,但今天突然 wampserver 没有启动。每当我右键单击任务栏图标并“启动所有服务”时,它都会变成橙色,但不会变成绿色。昨天有一个数据丢失问题,因为其中一个 mysql 表崩溃并且必须修复,如果这与此有关的话。
If I try http://localhost/phpmyadmin
, I get a 403 Forbidden
error, which I never got before.
如果我尝试http://localhost/phpmyadmin
,我会收到一个403 Forbidden
错误,这是我以前从未遇到过的。
I checked the apache log today and its latest entries are:
我今天检查了 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
Lines 25 and 26 on index_exe.php are simply as below (I was trying to log in to the application):
index_exe.php 上的第 25 和 26 行如下(我试图登录到应用程序):
$userName = mysql_real_escape_string($_POST['userName']);
$Password = mysql_real_escape_string($_POST['Password']);
Because of the [2002] No connection could be made because the target machine actively (trying to connect via tcp://localhost:3306
error, I figured maybe there's a problem with some other application using the same port, so I tried the following (my wamp is running on D:) :
由于该[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
But now I don't know what to make of this. I made sure my.ini had specified port 3306, and it had (anyway noone changed it in a year how could it suddenly have another value). Any help please! I think Apache is working because when I type in http://localhost
, it works and gives the option to go to phpmyadmin or my application folder, but it appears mysql services aren't starting up or something? I confirmed with the admin and no new software (such as Skype) have been installed or anything.
但现在我不知道该怎么办。我确保 my.ini 指定了端口 3306,并且它已经指定了(无论如何一年内没有人更改它怎么会突然有另一个值)。请任何帮助!我认为 Apache 正在工作,因为当我输入时http://localhost
,它可以工作并提供转到 phpmyadmin 或我的应用程序文件夹的选项,但似乎 mysql 服务没有启动或什么的?我与管理员确认并没有安装任何新软件(例如 Skype)或任何东西。
Update
更新
I went to Services.msc
and checked wampapache
, the status was "started".
But wampmysqld
had no status. So I right-clicked and chose "Start".
A message said "Windows is attempting to start the service on the local computer", but then I got this error:
我去Services.msc
检查wampapache
,状态是“开始”。却wampmysqld
没有地位。所以我右键单击并选择“开始”。一条消息说“Windows 正在尝试在本地计算机上启动该服务”,但随后出现此错误:
Windows could not start the wampmysqld service on Local Computer
Error 1067: The process terminated unexpectedly
What on earth is up? :(
这到底是怎么回事?:(
Update 2
更新 2
I got the mysql working again, here:
我让 mysql 再次工作,在这里:
mysqld working but wampmysqld not starting up
HowEVER, localhost://phpmyadmin
still gives me a 403 forbidden
error, and mysql_connect
keeps giving me an "Access denied" error.
然而,localhost://phpmyadmin
仍然给我一个403 forbidden
错误,并mysql_connect
不断给我一个“拒绝访问”错误。
回答by user2845576
This happened to me today. Since I had not changed my system setting since yesterday, I assumed it's predominantly a mysql issue on the system. I managed to fix it in the following way.
这件事今天发生在我身上。由于我从昨天起就没有更改系统设置,因此我认为这主要是系统上的 mysql 问题。我设法通过以下方式修复它。
Open wampserver's mysql log file. This will contain information on why the service threw and error and exited prematurely.
In my case, the mysql service failed to start because it could not read a certain tablespace. The specific tablespace was indicated in the log.
Failure to read such a file could be because of file permissions or the file being broken. In such a case, mysql stops executing in order to avoid damaging a tablespace file that may be linked to a database you need. Usually, if you have a backup of the database, then it is safe to simply delete this problematic file and restore the database once your mysql service is started again.
If you do not have a database backup then you could force the mysql instance to run a recovery by enabling the option in your my.cnf / my.ini file.
打开 wampserver 的 mysql 日志文件。这将包含有关服务为何抛出、错误和过早退出的信息。
就我而言,mysql 服务无法启动,因为它无法读取某个表空间。日志中指明了特定的表空间。
无法读取此类文件可能是因为文件权限或文件已损坏。在这种情况下,mysql 停止执行以避免损坏可能链接到您需要的数据库的表空间文件。通常,如果您有数据库的备份,那么只需删除这个有问题的文件并在您的 mysql 服务再次启动后恢复数据库是安全的。
如果您没有数据库备份,那么您可以通过启用 my.cnf / my.ini 文件中的选项来强制 mysql 实例运行恢复。
innodb_force_recovery = 1
innodb_force_recovery = 1
This forces the instance to run the crash recovery.
这会强制实例运行崩溃恢复。
NOTE:installing a new instance of mysql does not necessarily mean that your databases shall be retained. I suggest you run a nightly backup of your databases if you are working on huge projects.
注意:安装新的 mysql 实例并不一定意味着您的数据库将被保留。如果您正在处理大型项目,我建议您每晚对数据库进行一次备份。
回答by Regolith
Go to: wamp\bin\mysql\mysql5.6.17\data
and delete the following:
转到:wamp\bin\mysql\mysql5.6.17\data
并删除以下内容:
auto.cnf
, xxxxxxxxx.err
, xxxxxxxxx.pid
, ib_logfile0
and ib_logfile1
auto.cnf
, xxxxxxxxx.err
, xxxxxxxxx.pid
,ib_logfile0
和ib_logfile1
leave other file as it is.
保留其他文件原样。
if it is skype that is occupying your port 80 then go to skype: tools>option and in advance>connection uncheck "use port 80 and 443......"
如果是 Skype 占用了您的 80 端口,则转到 Skype:工具>选项并提前>连接取消选中“使用端口 80 和 443 ......”
回答by RustyIngles
I had the same issue, to resolve it I added the following line to my.ini
我遇到了同样的问题,为了解决它,我在 my.ini 中添加了以下行
innodb_force_recovery = 1
回答by MosabJ
I was running Wamp Server for more than a year,
Now I faced a problem that I couldn't start Wamp server (The icon just stay red and the error message appear)
我运行Wamp Server一年多了,
现在遇到了无法启动Wamp Server的问题(图标一直保持红色并出现错误消息)
I managed to uninstall Wamp and reinstall it again, and so I did, but before that I copied the folder from mysql/data to my desktop then when I reinstall it I copied that files to the original location.
我设法卸载 Wamp 并重新安装它,所以我做到了,但在此之前我将文件夹从 mysql/data 复制到我的桌面,然后当我重新安装它时,我将该文件复制到原始位置。
Then mysql just got confused... And phpmyadmin is not working so I fixed that by restoring the fresh install folder contents..
But I couldn't start mysql (the wamp servers icon still on yellow)
然后 mysql 就糊涂了……而且 phpmyadmin 无法正常工作,所以我通过恢复全新安装文件夹的内容来解决这个问题。
但我无法启动 mysql(wamp 服务器图标仍为黄色)
So after I googled a lot, I deleted every thing in the mysql/data except for:-
因此,在我搜索了很多之后,我删除了 mysql/data 中的所有内容,除了:-
mysql
test
performance_schema
And my problem solved :)
我的问题解决了:)
回答by GBDave In AL
I had this same problem...
我有同样的问题...
WampServer has been running fine since Feb on my local dev server. Today I couldn't get it to run.
WampServer 自 2 月以来在我的本地开发服务器上运行良好。今天我无法让它运行。
Off to google where I found this page and found no answers until I saw the last entry:
转到谷歌,在那里我找到了这个页面,直到我看到最后一个条目才找到答案:
"1.Run WampServer: Apache->service->test port 80.
”1.运行WampServer:Apache->服务->测试80端口。
2.Find out application which occupation port 80(e.g. skype)"
2.找出占用80端口的应用程序(例如Skype)”
So did and it returned that Skype was possibly blocking port 80.
也是如此,它返回说 Skype 可能阻止了端口 80。
Turned off Skype and the problem was solved.
关掉Skype,问题就解决了。
回答by vaibhso
I had the same problem. Mysql didn't start.
我有同样的问题。Mysql 没有启动。
- go to services.
- right click the wampmysqld go to properties.
- startup type select manual.
- right click and click start service.
- 去服务。
- 右键单击 wampmysqld 转到属性。
- 启动类型选择手动。
- 右键单击并单击启动服务。
worked for me.
为我工作。
回答by ibex
For me, adding innodb_force_recovery=3to my.inisolved the issue
对我来说,将innodb_force_recovery=3添加到my.ini解决了这个问题
Another option is removing ibdatafiles and all ib_logfilefrom the datadirectory , as explained in MySQL docs here. However this will cause any innoDB tables not to work(because the some information stored in ibdata1)
另一种选择是从数据目录中删除ibdata文件和所有ib_logfile,如MySQL 文档中所述。但是,这将导致任何 innoDB 表不起作用(因为某些信息存储在ibdata1 中)
回答by Pradip Sabhadiya
You may want to reset data from MySQL
您可能想要从 MySQL 重置数据
- delete previous data from C:\wamp\bin\mysql\mysql5.6.17\data
- restart service
- 从 C:\wamp\bin\mysql\mysql5.6.17\data 删除以前的数据
- 重启服务
回答by D.Kumar
Click on wamp (Yellow) icon
Go Apache-> Service-> Test port 80. If port is available to use then go to Apache->Service-> Install Service
then click on Restart All Services.
单击 wamp(黄色)图标
去 Apache-> 服务-> 测试端口 80。如果端口可用,然后去 Apache-> 服务-> 安装服务
然后单击重新启动所有服务。
回答by user4993200
Delete everything from this file.
删除此文件中的所有内容。
C:\wamp\bin\mysql\mysql5.1.36\data\mysql-bin.index
C:\wamp\bin\mysql\mysql5.1.36\data\mysql-bin.index
It works for me. My wamp server has turned green. Tnx a lot
这个对我有用。我的 wamp 服务器变绿了。Tnx 很多