mysql - Wampserver 图标没有完全变绿,mysql 服务没有启动?

标签 mysql apache wampserver

我在 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 active (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.msc 并检查了 wampapache,状态是“开始”。 但是 wampmysqld 没有状态。所以我右键单击并选择“开始”。 一条消息说“Windows 正在尝试在本地计算机上启动服务”,但随后我收到此错误:

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

到底怎么了? :(

更新 2

我的 mysql 又开始工作了,在这里:

mysqld working but wampmysqld not starting up

然而,localhost://phpmyadmin 仍然给我一个 403 禁止 错误,并且 mysql_connect 一直给我一个“拒绝访问”错误.

最佳答案

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

auto.cnfxxxxxxxxx.errxxxxxxxxx.pidib_logfile0ib_logfile1

保持其他文件不变。

如果是 skype 占用了你的 80 端口,那么去 skype: tools>option and in advance>connection uncheck "use port 80 and 443 ......"

关于mysql - Wampserver 图标没有完全变绿,mysql 服务没有启动?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17761931/

相关文章:

java - 在java上备份mysql数据库

mysql - 插入时触发 SQL 更新

java - Spring Boot webservice JDBC偶尔无法获得连接

java - 尝试在 Apache Tomcat 上部署 GWT 失败

apache - 使用 Apache Mahout 机器学习库

php - WordPress 只能使用 777 权限

php - 从 twilio 收到的电话号码格式

php - 出现 'Class PDO not found' 错误

wampserver 主页只能从本地主机可见

phpmyadmin - Wamp 服务器 phpMyAdmin 不是英文