Replication With MySQL 5 On Debian Etch problems

Discussion in 'HOWTO-Related Questions' started by bigdessert, Nov 3, 2007.

  1. bigdessert

    bigdessert New Member

    trying to follow this tutorial to setup replication on two cpanel vps's running centos. my first problem.

    if i add
    Code:
    bind-address           = 127.0.0.1
    to my.cnf

    then run:
    Code:
    mysqladmin -h a1.dccni.com -u root password XXXXX
    i get this error:

    Code:
    mysqladmin: connect to server at 'a1.dccni.com' failed
    error: 'Lost connection to MySQL server during query'
    
    If i run mysql withough the
    bind-address = 127.0.0.1 line, then i get this error:
    Code:
    mysqladmin: connect to server at 'a1.dccni.com' failed
    error: 'Access denied for user 'root'@'a1.dccni.com' (using password: YES)'
    

    any ideas why this could be?
     
  2. falko

    falko Super Moderator ISPConfig Developer

    Do you mean this tutorial? http://www.howtoforge.com/mysql5_master_master_replication_debian_etch
    It says that you must comment out the
    Code:
    bind-address           = 127.0.0.1
    line.

    Regarding the other error: please try the procedure outlined in chapter 8 on http://www.howtoforge.com/perfect_server_opensuse10.3_p4 (works for any distribution), beginning with "As you've seen in the netstat output, MySQL is not only listening on localhost, but on all interfaces, which means it can be accessed from the outside. Therefore we need to set a password for the user [email protected] as well. But there's one little problem: most likely the Host column in the mysql.user table doesn't contain server1.example.com, but server1. We will change that now, and afterwards we will set a MySQL password for the user [email protected]."
     
  3. falko

    falko Super Moderator ISPConfig Developer

    Oh, I've jsut seen that you're using CentOS. On CentOS, there's no
    Code:
    bind-address           = 127.0.0.1
    line...
    What's the output of
    Code:
    netstat -tap|grep mysql
    ?
     
  4. bigdessert

    bigdessert New Member

    server 1:
    Code:
    [[email protected] ~]# netstat -tap|grep mysql
    tcp        0      0 *:mysql                     *:*                         LISTEN      15459/mysqld
    
    server 2:
    Code:
    [[email protected] ~]# netstat -tap|grep mysql
    tcp        0      0 *:mysql                     *:*                         LISTEN      15932/mysqld
    [[email protected] ~]#
    
     
  5. falko

    falko Super Moderator ISPConfig Developer

    That's good, so you can skip the bind-address part of the tutorial. Try to proceed with the second half of my first post in this thread.
     
  6. bigdessert

    bigdessert New Member

    worked great got it working. Another question. If lets say i want to replicate another db, do i sync the databases and then add:

    Code:
    replicate-do-db = exampledb2
    and
    Code:
    binlog-do-db = exampledb2
    to both my.cnf files and restart mysql?

    Thanks for the help!
     
  7. falko

    falko Super Moderator ISPConfig Developer

    Yes, that's correct. :)
     

Share This Page