今天在测试环境中配置两个MySQL的复制,按照以前的方法,修改my.cnf之后启动,报错:
[root@XXXX ~]# /etc/init.d/mysql restart
ERROR! MySQL server PID file could not be found!
Starting MySQL......................................................................................................... ERROR! The server quit without updating PID file (/var/lib/mysql/XXXX.pid).
[root@XXXX ~]#
查看log,发现下面信息:
130418 6:15:52 [ERROR] /usr/sbin/mysqld: unknown variable 'master-host=x.x.x.x'
130418 6:15:52 [ERROR] Aborting
网上查了一下,才发现是MySQL5.5之后有了变化。有些参数不用了。官方文档如下:
Obsolete options. The following options are removed in MySQL 5.5. If you attempt to start mysqld with any of these options in MySQL 5.5, the server aborts with an unknown variable error. To set the replication parameters formerly associated with these options, you must use the CHANGE MASTER TO ...
statement (see Section 13.4.2.1, “CHANGE MASTER TO
Syntax”).
The options affected are shown in this list: