Well, long story...
I was working in my iMac, in a huge project, using Mysql Communit.
Today, I had a energy problem, and guess what, the computer turned off and MySql does not started anymore.
After look in logs, I saw the following messages:
2017-11-06T04:16:51.552023Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2017-11-06T04:16:51.552168Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2017-11-06T04:16:51.691183Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-11-06T04:16:51.692005Z 0 [Note] /usr/libexec/mysqld (mysqld 5.7.19) starting as process 6239 ...
2017-11-06T04:16:51.693960Z 0 [Note] InnoDB: PUNCH HOLE support available
2017-11-06T04:16:51.693980Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-11-06T04:16:51.693983Z 0 [Note] InnoDB: Uses event mutexes
2017-11-06T04:16:51.693986Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2017-11-06T04:16:51.693988Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2017-11-06T04:16:51.693991Z 0 [Note] InnoDB: Using Linux native AIO
2017-11-06T04:16:51.694122Z 0 [Note] InnoDB: Number of pools: 1
2017-11-06T04:16:51.694176Z 0 [Note] InnoDB: Using CPU crc32 instructions
2017-11-06T04:16:51.695065Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2017-11-06T04:16:51.699962Z 0 [Note] InnoDB: Completed initialization of buffer pool
2017-11-06T04:16:51.701084Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2017-11-06T04:16:51.713035Z 0 [ERROR] InnoDB: Checksum mismatch in datafile: ./ibdata1, Space ID:0, Flags: 0. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2017-11-06T04:16:51.713236Z 0 [Note] InnoDB: Restoring page [page id: space=0, page number=0] of datafile './ibdata1' from the doublewrite buffer. Writing 16384 bytes into file './ibdata1'
2017-11-06T04:16:51.713274Z 0 [ERROR] InnoDB: Checksum mismatch in datafile: ./ibdata1, Space ID:0, Flags: 0. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2017-11-06T04:16:51.713282Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption
2017-11-06T04:16:52.400003Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2017-11-06T04:16:52.400040Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2017-11-06T04:16:52.400045Z 0 [ERROR] Failed to initialize plugins.
2017-11-06T04:16:52.400048Z 0 [ERROR] Aborting
2017-11-06T04:16:52.400081Z 0 [Note] Binlog end
2017-11-06T04:16:52.400125Z 0 [Note] Shutting down plugin 'CSV'
2017-11-06T04:16:52.400313Z 0 [Note] /usr/libexec/mysqld: Shutdown complete
After google, I saw people recommending to add innodb_force_recovery=4 in my.cnf and see what happens. I was trying to do that, but looks like OS X just don“t respect my.cnf, so I have copied all my databases, tables, schemas and ibdata and log files to a linux box.
The Linux box works, but in all innodb_force_recovery, since from 1 to 4, the log error message was always the same.
I only had a different message with level 6. that was the following:
2017-11-06T04:36:25.802858Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2017-11-06T04:36:25.802991Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2017-11-06T04:36:25.944210Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-11-06T04:36:25.945429Z 0 [Note] /usr/libexec/mysqld (mysqld 5.7.19) starting as process 11545 ...
2017-11-06T04:36:25.948087Z 0 [Note] InnoDB: Started in read only mode
2017-11-06T04:36:25.948262Z 0 [Note] InnoDB: PUNCH HOLE support available
2017-11-06T04:36:25.948451Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-11-06T04:36:25.948580Z 0 [Note] InnoDB: Uses event mutexes
2017-11-06T04:36:25.948687Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2017-11-06T04:36:25.948815Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2017-11-06T04:36:25.948922Z 0 [Note] InnoDB: Using Linux native AIO
2017-11-06T04:36:25.949443Z 0 [Note] InnoDB: Number of pools: 1
2017-11-06T04:36:25.949655Z 0 [Note] InnoDB: Using CPU crc32 instructions
2017-11-06T04:36:25.949787Z 0 [Note] InnoDB: Disabling background log and ibuf IO write threads.
2017-11-06T04:36:25.950735Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2017-11-06T04:36:25.955733Z 0 [Note] InnoDB: Completed initialization of buffer pool
2017-11-06T04:36:25.957080Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2017-11-06T04:36:25.968077Z 0 [ERROR] InnoDB: Checksum mismatch in datafile: ./ibdata1, Space ID:0, Flags: 0. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2017-11-06T04:36:25.968365Z 0 [Note] InnoDB: Restoring page [page id: space=0, page number=0] of datafile './ibdata1' from the doublewrite buffer. Writing 16384 bytes into file './ibdata1'
2017-11-06T04:36:25.968507Z 0 [Warning] InnoDB: Retry attempts for writing partial data failed.
2017-11-06T04:36:25.968734Z 0 [ERROR] InnoDB: Write to file ./ibdata1failed at offset 0, 16384 bytes should have been written, only 0 were written. Operating system error number 9. Check that your OS and file system support files of this size. Check also that the disk is not full or a disk quota exceeded.
2017-11-06T04:36:25.968893Z 0 [ERROR] InnoDB: Error number 9 means 'Bad file descriptor'
2017-11-06T04:36:25.969060Z 0 [Note] InnoDB: Some operating system error numbers are described at http://dev.mysql.com/doc/refman/5.7/en/operating-system-error-codes.html
2017-11-06T04:36:25.969142Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption
2017-11-06T04:36:26.583400Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2017-11-06T04:36:26.583643Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2017-11-06T04:36:26.583908Z 0 [ERROR] Failed to initialize plugins.
2017-11-06T04:36:26.584133Z 0 [ERROR] Aborting
2017-11-06T04:36:26.585015Z 0 [Note] Binlog end
2017-11-06T04:36:26.585148Z 0 [Note] Shutting down plugin 'CSV'
2017-11-06T04:36:26.585562Z 0 [Note] /usr/libexec/mysqld: Shutdown complete
I have 100% sure that I have space, it is not a space problem, as you can see:
[root@localhost mysql]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 3.4G 0 3.4G 0% /dev
tmpfs 3.4G 0 3.4G 0% /dev/shm
tmpfs 3.4G 1.7M 3.4G 1% /run
tmpfs 3.4G 0 3.4G 0% /sys/fs/cgroup
/dev/mapper/fedora-root 17G 14G 2.1G 88% /
tmpfs 3.4G 148K 3.4G 1% /tmp
/dev/sda1 976M 158M 752M 18% /boot
Desktop 466G 261G 205G 57% /media/sf_Desktop
tmpfs 683M 28K 682M 1% /run/user/42
tmpfs 683M 4.6M 678M 1% /run/user/1000
tmpfs 683M 0 683M 0% /run/user/0
[root@localhost mysql]#
Any ideas? What else can I do?
I have all the tables files with .frm and .idb.
How can I rebuild this? I really need these data =/