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”。这是为什么呢?

解决方案 »

  1.   

    master-host这个参数已经废弃了
    你需要用change master to master_host='ss',master_user='aa',master_password='sss',master_log_file='ss',master_log_pos=4;来设置slave
      

  2.   

    从服务器配置文件server-id = 2
    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以上版本已经不支持在配置文件中指定主服务器相关选项。
      

  3.   

    你好!change master to是写在my.ini里的吗?
      

  4.   

    你好!change master to也是写在my.ini里的吗?
      

  5.   

    change master to master_host='192.168.1.200', master_user='', master_password='', aster_log_file='', master_log_pos=;
    不写在配置文件中(my.ini),在mysql的shell中执行。
      

  6.   

    http://www.mike.org.cn/articles/mysql-master-slave-sync-conf-detail/
    可以参考一下这篇文章,说的很详细
      

  7.   

    Server version: 5.5.19-log MySQL Community Server (GPL)
      

  8.   


    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>我这么写有问题吗?怎么提示错误呢?还有你给的这个链接我打不开啊。
      

  9.   

    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
    我这么写有问题吗,我觉得写的对呢?
    还有你发的这个链接我打不开啊?
      

  10.   

    你主从机的MySQL版本分别是多少?从机MySQL版本不能低于主机的MySQL版本的。