mysql 主从配置常遇到问题记录

在错误日志里看到如下输出:

InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes

把原来的 innodb 的ib_logfile×备份到一个目录下,然后删除掉原来的文件,重启 mysql。

/usr/local/webserver/mysql/sbin/mysqld: File '/usr/local/mysql/binlog/mysql-bin.index' not found (Errcode: 13)
120719  5:50:55 [ERROR] Aborting

cd /usr/local/mysql

chown -R mysql:mysql binlog

如果还不行

chmod -R 777 binlog/


ERROR 29 (HY000): File '/opt/mysql/3306/relaylog/relaylog.index' not found (Errcode: 2)

注释掉这3行配置,mysql重启即可

#relay-log-index = /opt/mysql/3306/relaylog/relaylog
#relay-log-info-file = /opt/mysql/3306/relaylog/relaylog
#relay-log = /opt/mysql/3306/relaylog/relaylog


ERROR 1201 (HY000): Could not initialize master info structure; more error messages can be found in the MySQL error log

slave stop

reset slave

你可能感兴趣的:(mysql,系统运维)