I have this error when running mysql
mysqld: File './binlog.000007' not found (OS errno 2 - No such file or directory)
2019-06-10T01:08:57.188811Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.16) starting as process 2210
2019-06-10T01:08:57.871257Z 0 [ERROR] [MY-010958] [Server] Could not open log file.
2019-06-10T01:08:57.871297Z 0 [ERROR] [MY-010041] [Server] Can't init tc log
2019-06-10T01:08:57.873856Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-06-10T01:08:59.423691Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.16) MySQL Community Server - GPL.
Does anyone know how to fix it?
In the same directory, you’ll find binlog.index
file.
windows: C:\Program Files\MySQL\MySQL Server X.0\data\binlog.index
Linux: /var/lib/mysql/binlog.index
Remove entry of './binlog.000007'
and restart the server..
answered Jun 2, 2021 at 14:29
OP doesn’t really tell us how mysql is being ran, might even be in xamp and that would be different. I think this answer does not provide context.
– marcogmonteiroJun 2, 2021 at 18:10
You don’t say where you’re running MySQL (inside Virtual Box, or a Docker image; Windows or Linux), but this should resolve the problem:
Woohoo, I found it! For now, at least. Digging through the source suggests that this might have something to do with mmap() calls, and lo and behold – VirtualBox has a bug in that area. Fortunately that same source hints at a workaround – the log_bin option. Enable this (either from the command line as
--log_bin
or from the config file aslog_bin=ON
) and things start to work again!
- Dude – if you think you “accidentally deleted the file” … then did you try RESTARTING THE MYSQL? If the restart fixed the problem – great. If it didn’t … do you really think mysql wouldn’t recreate the file itself??? Would you at least CONSIDER trying
log_bin=ON
(or equivalent)? – paulsm4 Jun 10, 2019 at 4:41 - Q: Have you found the problem? Q: Did you try setting log_bin and restarting mysql? – paulsm4 Jun 10, 2019 at 20:28
source : https://stackoverflow.com/questions/56519562/file-binlog-000007-not-found-os-errno-2-no-such-file-or-directory/67807124#67807124