use*_*627 11 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
Run Code Online (Sandbox Code Playgroud)
index_exe.php上的第25行和第26行简单如下(我试图登录到应用程序):
$userName = mysql_real_escape_string($_POST['userName']);
$Password = mysql_real_escape_string($_POST['Password']);
Run Code Online (Sandbox Code Playgroud)
由于[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
Run Code Online (Sandbox Code Playgroud)
但现在我不知道该怎么做.我确保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
Run Code Online (Sandbox Code Playgroud)
到底是什么?:(
我让mysql再次运行,在这里:
但是,localhost://phpmyadmin仍然给我一个403 forbidden错误,并mysql_connect不断给我一个"拒绝访问"错误.
小智 13
今天发生在我身上.由于我从昨天起没有改变我的系统设置,我认为它主要是系统上的mysql问题.我设法通过以下方式修复它.
打开wampserver的mysql日志文件.这将包含有关服务投掷和错误的原因以及过早退出的信息.
在我的情况下,mysql服务无法启动,因为它无法读取某个表空间.日志中指示了特定的表空间.
无法读取此类文件可能是因为文件权限或文件被破坏.在这种情况下,mysql会停止执行,以避免损坏可能链接到您需要的数据库的表空间文件.通常,如果您有数据库的备份,那么只需删除这个有问题的文件并在您的mysql服务再次启动后恢复数据库是安全的.
如果您没有数据库备份,则可以通过在my.cnf/my.ini文件中启用该选项来强制mysql实例运行恢复.
innodb_force_recovery = 1
这会强制实例运行崩溃恢复.
注意:安装新的mysql实例并不一定意味着应保留您的数据库.如果您正在开展大型项目,我建议您对数据库进行夜间备份.
转到:wamp\bin\mysql\mysql5.6.17\data并删除以下内容:
auto.cnf,xxxxxxxxx.err,xxxxxxxxx.pid,ib_logfile0和ib_logfile1
保留其他文件.
如果它是占用你的端口80的skype然后转到skype:tools>选项并提前>连接取消选中"使用端口80和443 ......"
我遇到了同样的问题,要解决这个问题,我将以下行添加到my.ini中
innodb_force_recovery = 1
Run Code Online (Sandbox Code Playgroud)
我运行Wamp Server已有一年多了,
现在我遇到了一个无法启动Wamp服务器的问题(图标只是保持红色并显示错误消息)
我设法卸载Wamp并重新安装它,所以我做了,但在此之前我将文件夹从mysql/data复制到我的桌面然后当我重新安装它时我将这些文件复制到原始位置.
然后mysql刚搞糊涂......而且phpmyadmin没有工作,所以我通过恢复全新的安装文件夹内容修复了..
但是我无法启动mysql(wamp服务器图标仍然是黄色的)
所以在我google了很多之后,我删除了mysql/data中的所有内容,除了: -
mysql
test
performance_schema
Run Code Online (Sandbox Code Playgroud)
我的问题解决了:)