Showing posts with label mysql replication. Show all posts
Showing posts with label mysql replication. Show all posts

Tuesday, September 11, 2012

mysql: replication for v5.5 up - unknown command variable master-host

got unknown command variable master-host

apparently, the ff variables (with other master options) for replication in mysql configuration file my.cnf were removed starting form version 5.5

master-host=223.223.223.35
master-user=repl
master-password=replMaster
master-port=3306


instead, you must issue the ff from mysql:

CHANGE MASTER TO MASTER_HOST="223.223.223.35", MASTER_USER="repl", MASTER_PASSWORD="replMaster", MASTER_LOG_FLIE="masterdb-bin.000001", MASTER_LOG_POS=1;


you can get the master log position by issuing SHOW MASTER STATUS in your master

don't forget to start slave
START SLAVE;

mysql: replication by db and table

if you want to setup replication in mysql for specific db only...

you can setup your master as:
# master

[mysqld]
port=3306
socket=/var/lib/mysql/mysql.sock

local-infile=1
server-id=1
log-bin
binlog-do-db=test_db

and your slave as:
# slave

[client]
port=3306
socket=/var/lib/mysql/mysql.sock

[mysqld]
port=3306
socket=/var/lib/mysql/mysql.sock

server-id=2
replicate-do-db=test_db


for replication of a specific table, use:
replicate-do-db=test_db.table1

Wednesday, January 04, 2012

mysql: skip replication error

if your replication halts because of an error, you can skip replication errors and continue replication

here's the command to skip 1 error then continue
# set global sql_slave_skip_counter=1; start slave;

SSH : No matching host key type found. Their offer: ssh-rsa,ssh-dss

Got this while connecting to my mikrotik router via ssh   Unable to negotiate with <ip address> port <ssh port>: no matching hos...