server-id=2
master-host=192.168.1.200
master-user=slave1
master-password=123456
master-port=3333
master-connect-retry=60
replicate-do-db=zoutuo
这个是我slave端my.ini的配置,现在这样配置后服务器不来,报错:111225 22:23:40 [Note] Plugin 'FEDERATED' is disabled.
111225 22:23:40 InnoDB: The InnoDB memory heap is disabled
111225 22:23:40 InnoDB: Mutexes and rw_locks use Windows interlocked functions
111225 22:23:40 InnoDB: Compressed tables use zlib 1.2.3
111225 22:23:40 InnoDB: Initializing buffer pool, size = 55.0M
111225 22:23:40 InnoDB: Completed initialization of buffer pool
111225 22:23:40 InnoDB: highest supported file format is Barracuda.
111225 22:23:40 InnoDB: Waiting for the background threads to start
111225 22:23:41 InnoDB: 1.1.8 started; log sequence number 1595675
111225 22:23:41 [ERROR] MySQL: unknown variable 'master-host=192.168.1.200'
111225 22:23:41 [ERROR] Aborting111225 22:23:41 InnoDB: Starting shutdown...
111225 22:23:41 InnoDB: Shutdown completed; log sequence number 1595675
111225 22:23:41 [Note] MySQL: Shutdown complete它提示错误的变量“master-host=192.168.1.200”。这是为什么呢?
master-host=192.168.1.200
master-user=slave1
master-password=123456
master-port=3333
master-connect-retry=60
replicate-do-db=zoutuo
这个是我slave端my.ini的配置,现在这样配置后服务器不来,报错:111225 22:23:40 [Note] Plugin 'FEDERATED' is disabled.
111225 22:23:40 InnoDB: The InnoDB memory heap is disabled
111225 22:23:40 InnoDB: Mutexes and rw_locks use Windows interlocked functions
111225 22:23:40 InnoDB: Compressed tables use zlib 1.2.3
111225 22:23:40 InnoDB: Initializing buffer pool, size = 55.0M
111225 22:23:40 InnoDB: Completed initialization of buffer pool
111225 22:23:40 InnoDB: highest supported file format is Barracuda.
111225 22:23:40 InnoDB: Waiting for the background threads to start
111225 22:23:41 InnoDB: 1.1.8 started; log sequence number 1595675
111225 22:23:41 [ERROR] MySQL: unknown variable 'master-host=192.168.1.200'
111225 22:23:41 [ERROR] Aborting111225 22:23:41 InnoDB: Starting shutdown...
111225 22:23:41 InnoDB: Shutdown completed; log sequence number 1595675
111225 22:23:41 [Note] MySQL: Shutdown complete它提示错误的变量“master-host=192.168.1.200”。这是为什么呢?
你需要用change master to master_host='ss',master_user='aa',master_password='sss',master_log_file='ss',master_log_pos=4;来设置slave
log-bin = /data0/mysql/binlog/binlog
replicate-do-db = test
replicate-ignore-db = mysql, information_schema
change master to master_host='192.168.1.200', master_user='', master_password='', aster_log_file='', master_log_pos=;master_log_file,master_log_pos由上面主服务器查出的状态值中确定。master_log_file对应File,master_log_pos对应Position。这些都可以在主服务器上查出来
show master status
mysql 5.x以上版本已经不支持在配置文件中指定主服务器相关选项。
不写在配置文件中(my.ini),在mysql的shell中执行。
可以参考一下这篇文章,说的很详细
mysql> change master to master_host='192.168.1.200', master_user='slave1',master
_password='123456',master_log_file='mysql-log.000005' master_log_pos='107';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'maste
r_log_pos='107'' at line 1
mysql>我这么写有问题吗?怎么提示错误呢?还有你给的这个链接我打不开啊。
_password='123456',master_log_file='mysql-log.000005' master_log_pos='107';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'maste
r_log_pos='107'' at line 1
我这么写有问题吗,我觉得写的对呢?
还有你发的这个链接我打不开啊?