Home > Database > Mysql Tutorial > MySQL无法主从复制解决方法_MySQL

MySQL无法主从复制解决方法_MySQL

WBOY
Release: 2016-06-01 13:01:45
Original
1359 people have browsed it

<span style="font-size:18px;">*******从数据库无法同步********
			show slave status 显示
                                       slave_sql_runing为NO,
                                       seconds_behind_master 为null
			原因:A:程序可能在slave上进行了写操作
				  B:也可能是slave机器重启后,事物回滚造成的
			解决一:slave stop;
				     set GLOBAL SQL_SLAVE_SKIP_COUNTER=1;  设置一个全局的参数
				     slave start;
			
			解决二:(1):salve(从)库, slave stop;   --停掉slave服务
					    master(主)库,show master status; 得到&A日志文名 &B 位置--得到主服务器上当前的二进制日志和偏移量 
					
				      (2):salve库:查看状态,能后到salve服务器上执行手动同步--人为操作
						change master to 
						master_host="192.168.101.1",
						master_uset="user1",
						master_password="pass123456",
						master_port=3306,
						master_log_file="mysql-bin.00003",     步骤(1)查出来的&A 日志文件名
						master_log_pos=98;					   步骤(1)查出来的&B 位置 --能后手动同步
					
					(3)启动salve服务
						salve start;
						
					(4)通过show salve status 查看
						Salve_SQL_Runing 为yes,
						Seconds_Behind_Master为0即为正常</span>
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template