解决mysql slave同步问题
2015-10-22 17:31
549 查看
解决办法:
1.首先停掉Slave服务:slave stop;
2.到主服务器上查看主机状态:
记录File和Position对应的值。
mysql> show master status;
+------------------+-----------+--------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+-----------+--------------+------------------+
| mysql-bin.000020 | 135617781 | | |
+------------------+-----------+--------------+------------------+
1 row in set (0.00 sec)
3.到slave服务器上执行手动同步:
mysql> change master to
> master_host='master_ip',
> master_user='user',
> master_password='pwd',
> master_port=3307,
> master_log_file='mysql-bin.000020',
> master_log_pos=135617781;
4.启动slave
slave start;
5.查看slave状态
show slave status \G;
本文出自 “不抛弃!不放弃” 博客,请务必保留此出处http://thedream.blog.51cto.com/6427769/1705320
1.首先停掉Slave服务:slave stop;
2.到主服务器上查看主机状态:
记录File和Position对应的值。
mysql> show master status;
+------------------+-----------+--------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+-----------+--------------+------------------+
| mysql-bin.000020 | 135617781 | | |
+------------------+-----------+--------------+------------------+
1 row in set (0.00 sec)
3.到slave服务器上执行手动同步:
mysql> change master to
> master_host='master_ip',
> master_user='user',
> master_password='pwd',
> master_port=3307,
> master_log_file='mysql-bin.000020',
> master_log_pos=135617781;
4.启动slave
slave start;
5.查看slave状态
show slave status \G;
本文出自 “不抛弃!不放弃” 博客,请务必保留此出处http://thedream.blog.51cto.com/6427769/1705320
相关文章推荐
- mysql event 事件
- 【转】MySQL随机字符串生成
- Windows Server 2003 下配置 MySQL 群集(Cluster)
- MySQL RESET MASTER与RESET SLAVE
- MySQL使用中的一些方法与技巧
- 2套mysql主从互切脚本
- MySQL 表锁以及FLUSH TABLES操作
- mysql c
- MySQL中general log使用
- JDBC-连接mysql查询数据时中文为空解决办法
- MySQL中数据库重命名
- MySQL UPDATE语句中的一个诡异现象
- MySQL中一些查看事务和锁情况的常用语句
- [转]MYSQL 查询优化
- mysql left( right ) join使用on 与where 筛选的差异
- MySQL NOT EXISTS优化的一个案例
- MySQL和MySQLi的区别
- MySQL DECIMAL数据类型
- 拯救mysql单表数据
- mysql 参数作用域