MySQL Relay Log File Not Found Error – Changing Data Directory

MySQLmysql-5.6

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?

Best Answer

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.