Announcement

Announcement Module
Collapse
No announcement yet.

Master-Master Replication issue

Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Master-Master Replication issue

    Hello,
    I have an issue to setup master-master replication

    The replication seems doesnt work for "CREATE DATABASE" sql command

    I have followed this guide
    https://www.digitalocean.com/communi...er-replication

    The replication works fine when databases are created on both servers however when I try to create new database its not replicated

    So when I do on one server "create database example" and "create table example.dummy (`id` varchar(10));"

    I cannot see it on the second one and it just shows this error in slave status

    "Last_Error: Error 'Unknown database 'example'' on query. Default database: ''. Query: 'create table example.dummy (`id` varchar(10))'"

    my.cnf conf server 1
    [mysqld]
    skip_name_resolve
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    user=mysql
    # Disabling symbolic-links is recommended to prevent assorted security risks
    symbolic-links=0
    server-id = 2
    log_bin = /var/log/mysql/mysql-bin.log
    binlog_do_db = setup
    # bind-address = 127.0.0.1

    server 2
    [mysqld]
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    user=mysql
    # Disabling symbolic-links is recommended to prevent assorted security risks
    symbolic-links=0
    server-id = 1
    log_bin = /var/log/mysql/mysql-bin.log
    binlog_do_db = setup
    skip_name_resolve

    any idea?

    Thank You in advnace


  • #2
    You are facing error because you requesting to logging only setup database changes.

    >> binlog_do_db = setup

    Creating any database tables outside setup table will fail. Please remove this option and restart mysql
    I foresee this will resolve the problem.

    Check this wonderful post.
    http://www.mysqlperformanceblog.com/...-is-dangerous/

    Comment

    Working...
    X