首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >MySQL复制-主位置未更改

问MySQL复制-主位置未更改
EN

Stack Overflow用户
提问于 2013-10-26 10:09:29
回答 1查看 1.7K关注 0票数 0

我的Master的位置没有更新,我已经查看了我能找到的所有其他复制问题的帖子...还是不走运。下面是我得到的信息:

Master /etc/my.cnf

代码语言:javascript
复制
[mysqld]
server-id = 1
log-bin = /var/log/mysql/binary.log
binlog_do_db = securityDB

从/etc/my.cnf

代码语言:javascript
复制
[mysqld]
server-id = 2 
master-host = 192.168.1.130
master-port = 3306
master-user = slave
master-password = slave
replicate-do-db = securityDB

主机上的processlist显示备机已连接:

代码语言:javascript
复制
    *************************** 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%’这样的主变量:

代码语言:javascript
复制
+-----------------------------------------+----------------------+
| 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%':

代码语言:javascript
复制
 +-----------------------------------------+--------------------------------+
    | 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日志...没有什么能把我带到那里。我相信这是很简单的..。

任何建议都将不胜感激。

EN

回答 1

Stack Overflow用户

发布于 2014-01-22 16:04:13

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

该命令为:

代码语言:javascript
复制
service mysqld restart
票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19602073

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档