I want to change data directory of my mysql server running 5.6.28 on centos 5.11. Its a slave to some master server. i have edited the config file ,moved the data contents from old directory to new required directory. When i tried to start the server it failed to start with below error in error log.

/usr/sbin/mysqld: File '/oldpath/to/log/mysql_bin.000220' not found [ERROR] Failed to open log (file '/oldpath/to/log/mysql_bin.000220', errno 2)

so its still referring old binary log file path. I am not sure why its not referring new binary log file path where the mysql_bin.000220 present and getting failed to start. Any idea why server throwing this error and not starting?

  • Check the mysql_bin.index file if it maybe contains full paths to the indexed log files? Check your my.cnf for the old path references.
    – jkavalik
    May 18, 2016 at 6:33
  • You are right. mysql_bin.index file contains full paths. binlog index file and relay log index file will contain paths of log files based on log_bin and relay-log variables in config file.So whenever we are changing data directory we need to manually edit the binlog index file when the server is down to refer new paths if they contain full path. if there is no full path , no need to edit anything in index files. if my understanding is correct, can you please post the same in answer. so that i can accept the answer.
    – kasi
    May 18, 2016 at 7:01

1 Answer 1


From the manual:

An absolute path remains unchanged; in such a case, the index must be edited manually to enable the new path or paths to be used. Previous to MySQL 5.6.5, manual intervention was required whenever relocating the binary log or relay log files. (Bug #11745230, Bug #12133)

So if your binlog index was written with the full paths, you need to update it manually or using the mysqlbinlogmove utility.

Your Answer

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

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