0

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

主 /etc/my.cnf

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

从机 /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

master 上的 processlist 显示 slave 已连接:

    *************************** 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 日志……没有什么能让我到达那里。我敢肯定这很简单......

任何建议将不胜感激。

4

1 回答 1

-1

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

命令是:

service mysqld restart
于 2014-01-22T08:04:12.753 回答