MySQL复制 - 主位置不变

时间:2013-10-26 02:09:29

标签: mysql position replication

我的主人的位置没有更新,我经历了我能找到的所有其他复制问题帖子......仍然没有运气。这就是我所拥有的:

Master /etc/my.cnf

[mysqld]
server-id = 1
log-bin = /var/log/mysql/binary.log
binlog_do_db = securityDB

Slave /etc/my.cnf

[mysqld]
server-id = 2 
master-host = 192.168.1.130
master-port = 3306
master-user = slave
master-password = slave
replicate-do-db = securityDB

主站上的进程列表显示从站已连接:

    *************************** 4. row ***************************
         Id: 86
       User: root
       Host: localhost:59948
         db: securitydb
    Command: Sleep
       Time: 350
      State: 
       Info: NULL
    *************************** 5. row ***************************
         Id: 138
       User: root
       Host: localhost
         db: securitydb
    Command: Query
       Time: 0
      State: NULL
       Info: show processlist
    *************************** 6. row ***************************
         Id: 187
       User: slave
       Host: macbookpro17:59477
         db: NULL
    Command: Binlog Dump
       Time: 600
      State: Master has sent all binlog to slave; waiting for binlog to be updated
       Info: NULL

The slave process list shows that it's connected to the master:
*************************** 5. row ***************************
     Id: 532
   User: root
   Host: localhost
     db: securitydb
Command: Sleep
   Time: 689
  State: 
   Info: NULL
*************************** 6. row ***************************
     Id: 922
   User: system user
   Host: 
     db: NULL
Command: Connect
   Time: 715
  State: Waiting for master to send event
   Info: NULL
*************************** 7. row ***************************
     Id: 923
   User: system user
   Host: 
     db: NULL
Command: Connect
   Time: 714
  State: Slave has read all relay log; waiting for the slave I/O thread to update it
   Info: NULL

主变量,例如'%bin%':

+-----------------------------------------+----------------------+
| Variable_name                           | Value                |
+-----------------------------------------+----------------------+
| binlog_cache_size                       | 32768                |
| binlog_direct_non_transactional_updates | OFF                  |
| binlog_format                           | STATEMENT            |
| binlog_stmt_cache_size                  | 32768                |
| innodb_locks_unsafe_for_binlog          | OFF                  |
| log_bin                                 | ON                   |
| log_bin_trust_function_creators         | OFF                  |
| max_binlog_cache_size                   | 18446744073709547520 |
| max_binlog_size                         | 1073741824           |
| max_binlog_stmt_cache_size              | 18446744073709547520 |
| sql_log_bin                             | ON                   |
| sync_binlog                             | 0                    |
+-----------------------------------------+----------------------+

奴隶变量,如'%bin%':

 +-----------------------------------------+--------------------------------+
    | Variable_name                           | Value                          |
    +-----------------------------------------+--------------------------------+
    | bind_address                            | *                              |
    | binlog_cache_size                       | 32768                          |
    | binlog_checksum                         | CRC32                          |
    | binlog_direct_non_transactional_updates | OFF                            |
    | binlog_format                           | STATEMENT                      |
    | binlog_max_flush_queue_time             | 0                              |
    | binlog_order_commits                    | ON                             |
    | binlog_row_image                        | FULL                           |
    | binlog_rows_query_log_events            | OFF                            |
    | binlog_stmt_cache_size                  | 32768                          |
    | innodb_api_enable_binlog                | OFF                            |
    | innodb_locks_unsafe_for_binlog          | OFF                            |
    | log_bin                                 | ON                             |
    | log_bin_basename                        | /var/lib/mysql/mysql-bin       |
    | log_bin_index                           | /var/lib/mysql/mysql-bin.index |
    | log_bin_trust_function_creators         | OFF                            |
    | log_bin_use_v1_row_events               | OFF                            |
    | max_binlog_cache_size                   | 18446744073709547520           |
    | max_binlog_size                         | 1073741824                     |
    | max_binlog_stmt_cache_size              | 18446744073709547520           |
    | sql_log_bin                             | ON                             |
    | sync_binlog                             | 0                              |
    +-----------------------------------------+--------------------------------+

但主要位置没有移动,并且复制被卡住了。我注意到数据库显示在进程列表中的所有小写字母,但我已将replicate_do_db更改为全部小写,但它没有帮助。数据库名称实际上是securityDB。我尝试过主复位,从机复位,创建新的bin日志......没有什么能让我在那里。我确定这很简单...

非常感谢任何建议。

1 个答案:

答案 0 :(得分:-1)

更改/etc/mysql/my.cnf文件后需要重启mysql服务器。

命令是:

service mysqld restart