MySQL服务没有运行

时间:2015-11-19 05:17:18

标签: php mysql phpmyadmin wampserver

我遇到了MySQL的问题。 WAMP是橙色的在线服务,但不是MySQL。它显示以下错误:

  

#2002 - 无法建立连接,因为目标计算机主动拒绝它。

这是日志错误:

2015-11-18 22:13:24 7408 [Note] Plugin 'FEDERATED' is disabled.
2015-11-18 22:13:24 7408 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-11-18 22:13:24 7408 [Note] InnoDB: The InnoDB memory heap is disabled
2015-11-18 22:13:24 7408 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2015-11-18 22:13:24 7408 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-11-18 22:13:24 7408 [Note] InnoDB: Not using CPU crc32 instructions
2015-11-18 22:13:24 7408 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-11-18 22:13:24 7408 [Note] InnoDB: Completed initialization of buffer pool
2015-11-18 22:13:24 7408 [Note] InnoDB: Highest supported file format is Barracuda.
2015-11-18 22:13:24 7408 [Note] InnoDB: The log sequence numbers 101407365 and 101407365 in ibdata files do not match the log sequence number 101451472 in the ib_logfiles!
2015-11-18 22:13:24 7408 [Note] InnoDB: Database was not shutdown normally!
2015-11-18 22:13:24 7408 [Note] InnoDB: Starting crash recovery.
2015-11-18 22:13:24 7408 [Note] InnoDB: Reading tablespace information from the .ibd files...
2015-11-18 22:13:24 7408 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace catalog_estudio/ost_qacomments uses space ID: 70 at filepath: .\catalog_estudio\ost_qacomments.ibd. Cannot open tablespace osticket/ost_content which uses space ID: 70 at filepath: .\osticket\ost_content.ibd
InnoDB: Error: could not open single-table tablespace file .\osticket\ost_content.ibd
InnoDB: We do not continue the crash recovery, because the table may become
InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.

我试图找到my.cnf,但它并不存在。我删除了.ibd个文件,但问题仍然存在。

1 个答案:

答案 0 :(得分:0)

服务器上的MySQL端口要么是防火墙,要么是mysql没有监听该端口。 "积极拒绝"表示目标计算机返回"连接被拒绝"。

更改此文件:" C:\ wamp \ bin \ mysql [mysql_version] \ my.ini"

[client]
#password = your_password
port = 3306
socket = /tmp/mysql.sock

和MySQL服务器 [wampmysqld]

port = 3306
socket = /tmp/mysql.sock

您可以将端口号默认3306更改为3309,如。

<强>更新

mysql.sock不是一个你可以创建的简单文件。 MySQL将在一开始就由&#34;本身&#34;创建。 尝试启动MySQL,然后为我们提供完整的mysqld.log。

我认为它是以下内容,并且可以在其中找到解决方法/解决方案:

InnoDB: Error: could not open single-table tablespace file .\mysql\slave_worker_info.ibd 
InnoDB: We do not continue the crash recovery, because the table may become 
InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it. 
InnoDB: To fix the problem and start mysqld: 
InnoDB: 1) If there is a permission problem in the file and mysqld cannot 
InnoDB: open the file, you should modify the permissions. 
InnoDB: 2) If the table is not needed, or you can restore it from a backup, 
InnoDB: then you can remove the .ibd file, and InnoDB will do a normal 
InnoDB: crash recovery and ignore that table. 
InnoDB: 3) If the file system or the disk is broken, and you cannot remove 
InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf 
InnoDB: and force InnoDB to continue crash recovery here. 

1)如果文件中存在权限问题且mysqld无法打开文件,则应修改权限。

2)如果不需要表,或者您可以从备份中恢复它,那么您可以删除.ibd文件,InnoDB将执行正常的崩溃恢复并忽略该表。

3)如果文件系统或磁盘损坏,并且您无法删除.ibd文件,则可以设置innodb_force_recovery&gt; my.cnf中的0并强制InnoDB继续崩溃恢复:

1) In [mysqld] section, add the following line: 
innodb_force_recovery = 1 
2) Save the file and try starting MySQL. 
3) when recovery is finished, remove that line which you just added and restart MySQL. 
相关问题