Search code examples
phpmysqlphpmyadminwampserver

MySQL service doesn't run


I have a problem with MySQL. WAMP is orange with service online, but not MySQL. It displays the following error:

#2002 - No connection could be made because the target machine actively refused it.

This is the log error:

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.

I tried to find my.cnf but it doesn't exist. I removed the .ibd files but the issue remains the same.


Solution

  • MySQL port on the server is either firewalled, or mysql isn't listening on that port. "actively refusing" means the target machine returned a "connection refused".

    Change this file: "C:\wamp\bin\mysql[mysql_version]\my.ini"

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

    and MySQL server [wampmysqld]

    port = 3306
    socket = /tmp/mysql.sock
    

    You could change port number default 3306 to 3309 like.

    UPDATE

    mysql.sock is not a simple file which you can just create. MySQL will create on the start by "itself". Try to start MySQL and then provide us with a full mysqld.log.

    I assume that it`s the following and workaround/solution can be found here itself in it:

    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) If there is a permission problem in the file and mysqld cannot open the file, you should modify the permissions.

    2) If the table is not needed, or you can restore it from a backup, then you can remove the .ibd file, and InnoDB will do a normal crash recovery and ignore that table.

    3) If the file system or the disk is broken, and you cannot remove the .ibd file, you can set innodb_force_recovery > 0 in my.cnf and force InnoDB to continue crash recovery here:

    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.