mySql主从配置出错:The server is not configured as slave; fix in config file or with CHANGE MASTER TO
来源:互联网 发布:嘉实多机油网络代理商 编辑:程序博客网 时间:2024/05/16 12:29
数据库已搭建完成,各种配置均已完成,但是在start slave ;的时候,报错:
ERROR 1200 (HY000): The server is not configured as slave; fix in config file or with CHANGE MASTER TO这里说,我没有配置为从机,但我明明配置过的啊。
MySQL版本:5.6.19
主:master IP : 172.17.210.199
从:slave IP :172.17.206.138
先看看从机172.17.206.138的my.cnf
尝试过多次 重启主从还是报错;
接着手动chang to 后还是一样报错
在从库服务器执行START slave;命令启动slave报错:
ERROR 1200 (HY000): The server is not configured as slave; fix in config file or with CHANGE MASTER TO
于是查看日志
1.查看SLAVE172.17.206.138上的Mysql报错日志,有这么一句:
141009 6:06:29 [ERROR] Server id not set, will not start slave
意思是,slave的server-id没有设置。
那就奇怪了,我明明在配置文件里面指定了server-id的了,并且有重启mysql服务,难道不起效?
分别在主从上执行命令“show variables like 'server_id';”。
-------主机上面查看
既然参数文件不生效,就试试在数据库命令里面设置:在从机 172.17.206.138上执行命令再次在从机 172.17.206.138上执行slave start和show slave status,成功了。
注意!!!由于“SET GLOBAL server_id=;”命令会在mysql服务重启后丢失,所以一定要写到配置文件里面。
但为什么我之前修改了my.cnf文件不起效?
仔细排查,发现配置里面有[mysqld]和[mysqld_safe],之前将修改的配置内容基本都放在了[mysqld_safe]下面,新增的配置文件放的位置不一样也有关系?于是我尝试把配置文件里修改的部分放在[mysqld]下面,于是改成这样:
如图,就是将图中标注的内容从[mysqld_safe]下修改到[mysqld]下
修改之后,再次同步,成功了!
阅读全文
0 0
- mySql主从配置出错:The server is not configured as slave; fix in config file or with CHANGE MASTER TO
- Mysql 出现错误The server is not configured as slave; fix in config file or with CHANGE MASTER TO
- MySQL之——主从server-id不生效,The server is not configured as slave
- mysql 5.5 主从同步数据到 msyql5.6数据库,报错为Slave is not configured or failed to initialize properly. You must
- mysql 主从配置(master/slave)
- 解决The current branch is not configured for pull No value for key branch.master.merge found in config
- 解决The current branch is not configured for pull No value for key branch.master.merge found in config
- 解决The current branch is not configured for pull No value for key branch.master.merge found in config
- The current branch is not configured for pull No value for key branch.master.merge found in config
- 解决The current branch is not configured for pull No value for key branch.master.merge found in config
- 解决The current branch is not configured for pull No value for key branch.master.merge found in config
- 解决The current branch is not configured for pull No value for key branch.master.merge found in config
- 解决The current branch is not configured for pull No value for key branch.master.merge found in config
- 解决The current branch is not configured for pull No value for key branch.master.merge found in config
- The current branch is not configured for pull No value for key branch.master.merge found in config
- 解决The current branch is not configured for pull No value for key branch.master.merge found in config
- 解决The current branch is not configured for pull No value for key branch.master.merge found in config
- A slave with the same server_uuid as this slave has connected to the master
- 算法导论--快速排序
- python+matplot+pyplot画图
- wamp配置出现You don't have permission to access / on this server.
- 动态网页
- HDU5781 ATM
- mySql主从配置出错:The server is not configured as slave; fix in config file or with CHANGE MASTER TO
- php mysql mysqli php7性能测试
- Django 注册功能
- MYSQL启用日志,和查看日志
- Moveit和OMPL的使用
- 数据结构 C语言版 第一章笔记 基本概念和术语
- QML之Column垂直定位器
- 菜鸟看源码之ArrayList
- BZOJ 1502 计算几何+自适应Simpson积分 解题报告