2

I've copied data/binlog files between MariaDB (10.3) instances and wanted to change the location of data/log files on the new machine. I adjusted the paths in the my.cnf file. On start on the new machine, the mysqld continues to refer to the old locations, ignoring the paths specified in the my.cnf file - this obviously results in an error like so:

mysqld [ERROR] mysqld: File '<old-location>/mariadb-bin.000160' not found (Errcode: 2 "No such file or directory")
mysqld [ERROR] Failed to open log (file '<old-location>/mariadb-bin.000160', errno 2)
mysqld [ERROR] Could not open log file
mysqld [ERROR] Can't init tc log
mysqld [ERROR] Aborting'

I grepped and found that the ibdata1 file has a reference to the old path - is this something that needs to be updated with mysql CLI prior to the migration?

As far as I can tell, this is not the same as the problem described here: https://stackoverflow.com/questions/7660410/try-to-change-bin-log-directory-mysql-bin-index-not-found-errcode-13

The new instance continues to refer to the old path, despite the my.cnf change. Neither this is a permissions problem (like with apparmor or file ownership).

1 Answer 1

3

I finally figured it out: MariaDB keeps an "index" file, fortunately ASCII, that you need to edit: mariadb-bin.index located in the binlog directory (or wherever your log_bin_index configuration points at). This file lists all the binlog files with their full paths. This is unfortunate as the paths should be relative to the log_bin configuration setting. Example:

$ head mariadb-bin.index
/<binlog path>/mariadb-bin.000001
/<binlog path>/mariadb-bin.000002

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.