<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>《mysql主从切换》的评论</title>
	<atom:link href="https://www.xifenfei.com/2011/09/mysql%e4%b8%bb%e4%bb%8e%e5%88%87%e6%8d%a2.html/feed" rel="self" type="application/rss+xml" />
	<link>https://www.xifenfei.com/2011/09/mysql%e4%b8%bb%e4%bb%8e%e5%88%87%e6%8d%a2.html</link>
	<description>提供7*24专业数据库(Oracle,SQL Server,MySQL,PostgreSQL等)恢复和技术支持@Tel:17813235971</description>
	<lastBuildDate>Thu, 11 Dec 2025 02:46:14 +0000</lastBuildDate>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>作者：惜 分飞</title>
		<link>https://www.xifenfei.com/2011/09/mysql%e4%b8%bb%e4%bb%8e%e5%88%87%e6%8d%a2.html/comment-page-1#comment-161</link>
		<dc:creator><![CDATA[惜 分飞]]></dc:creator>
		<pubDate>Fri, 16 Sep 2011 17:09:34 +0000</pubDate>
		<guid isPermaLink="false">https://www.xifenfei.com/?p=1559#comment-161</guid>
		<description><![CDATA[1、重启是的修改的配置文件生效
2、不重启，有时候，slave进程不会正常工作]]></description>
		<content:encoded><![CDATA[<p>1、重启是的修改的配置文件生效<br />
2、不重启，有时候，slave进程不会正常工作</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：likydva</title>
		<link>https://www.xifenfei.com/2011/09/mysql%e4%b8%bb%e4%bb%8e%e5%88%87%e6%8d%a2.html/comment-page-1#comment-159</link>
		<dc:creator><![CDATA[likydva]]></dc:creator>
		<pubDate>Fri, 16 Sep 2011 04:00:48 +0000</pubDate>
		<guid isPermaLink="false">https://www.xifenfei.com/?p=1559#comment-159</guid>
		<description><![CDATA[为什么最后还要重启呢？　[root@localhost mysql]# service mysql restart]]></description>
		<content:encoded><![CDATA[<p>为什么最后还要重启呢？　[root@localhost mysql]# service mysql restart</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：惜 分飞</title>
		<link>https://www.xifenfei.com/2011/09/mysql%e4%b8%bb%e4%bb%8e%e5%88%87%e6%8d%a2.html/comment-page-1#comment-153</link>
		<dc:creator><![CDATA[惜 分飞]]></dc:creator>
		<pubDate>Tue, 13 Sep 2011 14:32:46 +0000</pubDate>
		<guid isPermaLink="false">https://www.xifenfei.com/?p=1559#comment-153</guid>
		<description><![CDATA[1、修改主从参数
主库：
relay-log=/opt/mysql/mysqldata/mysqllog/replicate
relay-log-index=/opt/mysql/mysqldata/mysqllog/replicate.index
read-only=1
skip-slave-start=1
innodb_flush_log_at_trx_commit = 1
sync-binlog=1
备库：
#read-only=1

2、查看主备库状态
show slave status \G
show master status \G

3、操作备库
STOP SLAVE IO_THREAD;
SHOW PROCESSLIST;
看到Has read all relay log
show slave status \G
STOP SLAVE;
RESET MASTER;
RESET SLAVE;
show master status \G

4、操作主库
show master status \G
RESET MASTER;
RESET SLAVE;
CHANGE MASTER TO
MASTER_HOST=&#039;192.168.1.4&#039;,
MASTER_USER=&#039;repl&#039;,
MASTER_PASSWORD=&#039;xifenfei&#039;,
MASTER_LOG_FILE=&#039;mysq_lbin.000001&#039;,
MASTER_LOG_POS=107;

5、重启新主从库，开启slave进程，检查是否正常
主库
SHOW PROCESSLIST;
show master status \G
从库
start slave;
SHOW PROCESSLIST;
show slave status \G]]></description>
		<content:encoded><![CDATA[<p>1、修改主从参数<br />
主库：<br />
relay-log=/opt/mysql/mysqldata/mysqllog/replicate<br />
relay-log-index=/opt/mysql/mysqldata/mysqllog/replicate.index<br />
read-only=1<br />
skip-slave-start=1<br />
innodb_flush_log_at_trx_commit = 1<br />
sync-binlog=1<br />
备库：<br />
#read-only=1</p>
<p>2、查看主备库状态<br />
show slave status \G<br />
show master status \G</p>
<p>3、操作备库<br />
STOP SLAVE IO_THREAD;<br />
SHOW PROCESSLIST;<br />
看到Has read all relay log<br />
show slave status \G<br />
STOP SLAVE;<br />
RESET MASTER;<br />
RESET SLAVE;<br />
show master status \G</p>
<p>4、操作主库<br />
show master status \G<br />
RESET MASTER;<br />
RESET SLAVE;<br />
CHANGE MASTER TO<br />
MASTER_HOST=&#8217;192.168.1.4&#8242;,<br />
MASTER_USER=&#8217;repl&#8217;,<br />
MASTER_PASSWORD=&#8217;xifenfei&#8217;,<br />
MASTER_LOG_FILE=&#8217;mysq_lbin.000001&#8242;,<br />
MASTER_LOG_POS=107;</p>
<p>5、重启新主从库，开启slave进程，检查是否正常<br />
主库<br />
SHOW PROCESSLIST;<br />
show master status \G<br />
从库<br />
start slave;<br />
SHOW PROCESSLIST;<br />
show slave status \G</p>
]]></content:encoded>
	</item>
</channel>
</rss>
