mysql复制将slave转化为master

更改my.cnf配置后出现下面的错误提示:
[bash]
[root@zt_script ~]# service mysqld restart
Shutting down MySQL. [ OK ]
Starting MySQL..The server quit without updating PID file ([FAILED]sql/zt_script.pid).
[/bash]

查看错误日志
[bash]
121224 11:01:44 [Warning] Neither –relay-log nor –relay-log-index were used; so replication may break when this MySQL server acts as a slav
e and has his hostname changed!! Please use ‘–relay-log=zt_script-relay-bin’ to avoid this problem.
121224 11:01:44 [ERROR] Failed to open the relay log ‘./mysql-relay-bin.000004′ (relay_log_pos 504)
121224 11:01:44 [ERROR] Could not find target log during relay log initialization
121224 11:01:44 [ERROR] Failed to initialize the master info structure
[/bash]
解决方法:
1.停止slave:
[bash]
slave stop;
reset slave;
[/bash]
2.停止mysqld
[bash]
service mysqld stop
[/bash]
3.然后备份现有的mysql-bin.index和mysql-relay-bin.*日志文件;
4.再删除上面备份前的日志文件;
5.重启即可。