MySQL wird nicht gestartet, da mysql-bin nicht gefunden werden kann.000006 (Errcode 2), wie behebe ich das?

MySQL (Teil von AMPPS) funktionierte plötzlich nicht mehr. Wenn man sich mysql.err ansieht, heißt es, dass es nicht gestartet werden kann, weil es mysql-bin.000006 nicht finden kann (Fehler 2).

Hier ist das vollständige Protokoll von MySQL.err:

130401 17:00:47 InnoDB: The InnoDB memory heap is disabled
130401 17:00:47 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130401 17:00:47 InnoDB: Compressed tables use zlib 1.2.3
130401 17:00:47 InnoDB: Initializing buffer pool, size = 128.0M
130401 17:00:47 InnoDB: Completed initialization of buffer pool
130401 17:00:47 InnoDB: highest supported file format is Barracuda.
130401 17:00:49  InnoDB: Waiting for the background threads to start
130401 17:00:50 InnoDB: 1.1.8 started; log sequence number 193114266
/Applications/AMPPS/mysql/bin/mysqld: File './mysql-bin.000006' not found (Errcode: 2)
130401 17:00:50 [ERROR] Failed to open log (file './mysql-bin.000006', errno 2)
130401 17:00:50 [ERROR] Could not open log file
130401 17:00:50 [ERROR] Can't init tc log
130401 17:00:50 [ERROR] Aborting

130401 17:00:50  InnoDB: Starting shutdown...
130401 17:00:50  InnoDB: Shutdown completed; log sequence number 193114266
130401 17:00:50 [Note] /Applications/AMPPS/mysql/bin/mysqld: Shutdown complete

Hier ist das Verzeichnis, in dem alle binären Protokolldateien leben:

drwx------  128 cyberskull  admin      4352 Mar 31 02:46 redacted
-rw-rw----    1 cyberskull  admin   5242880 Apr  1 17:00 ib_logfile0
-rw-rw----    1 cyberskull  admin   5242880 Mar 31 02:46 ib_logfile1
-rw-rw----    1 cyberskull  admin  44040192 Apr  1 17:00 ibdata1
drwxr-xr-x@  74 cyberskull  admin      2516 Jan 30 22:31 mysql
-rw-rw----    1 cyberskull  admin   2053929 Mar 18 23:18 mysql-bin.000001
-rw-rw----    1 cyberskull  admin  44002874 Mar 23 19:40 mysql-bin.000002
-rw-rw----    1 cyberskull  admin  25182139 Mar 25 20:59 mysql-bin.000003
-rw-rw----    1 cyberskull  admin  21533910 Mar 28 19:51 mysql-bin.000004
-rw-rw----    1 cyberskull  admin  32820396 Mar 29 18:45 mysql-bin.000005
-rw-rw----    1 cyberskull  admin       114 Mar 30 14:33 mysql-bin.index
-rw-rw----@   1 cyberskull  admin    114303 Apr  1 17:00 mysql.err
drwxr-xr-x@  20 cyberskull  admin       680 Jan 30 22:31 performance_schema
drwxr-xr-x@   2 cyberskull  admin        68 Jan 30 22:31 test

Was muss ich tun, um MySQL wieder zum Laufen zu bringen?

Author: CyberSkull, 2013-04-02

2 answers

OPTION #1

Verschieben Sie einfach die Binärprotokolle beiseite und starten Sie mysql

mv mysql-bin.* ..

Dann starten Sie mysql

OPTION #2

Bearbeiten Sie die Datei mysql-bin.index und entfernen Sie die Zeile mit mysql-bin.0000006

Dann starten Sie mysql

Probieren Sie es aus !!!

 6
Author: RolandoMySQLDBA,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/techietown.info/template/agent.layouts/content.php on line 61
2020-06-12 13:48:39

Sie haben zwei Möglichkeiten:

  1. Benennen Sie mysql-bin um.index zu mysql-bin.alt. Auf diese Weise kann die Datei nicht gefunden werden, aber Sie haben sie immer noch, wenn Sie sie benötigen.

  2. Geben Sie den folgenden Befehl ein:

    cp mysql-bin.000002 mysql-bin.000006
    

    Optional können Sie danach das Datum und die Uhrzeit ändern, wenn Sie diesen Befehl ausführen:

    PURGE BINARY LOGS BEFORE '2013-03-14 10:00:00';
    
 -1
Author: cybernard,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/techietown.info/template/agent.layouts/content.php on line 61
2013-04-04 05:31:08