Selected from Linux Selected from PHP
- Ubuntu 17.10 Install google's mod pagespeed for apache - PHP-Ubuntu-Youtube-dl simple script for converting and downloading youtube video or mp3
- Ubuntu SSH tunnel via proxy - PHP while loop with every row with a different color
- Install GoAccess Apache Log Analyzer Tool on Ubuntu 17.10 - PHP use while loop in function
- SSHFS and map folder with a proxy - PHP List Files And Folders As links
- How to connect to SSH server with a proxy - PHP Extract Text From String
➥ Ubuntu 16.04 MySQL replication
Added by sonik on 02-05-2017 and keywords: [ Print Article ]
10.20.6.29 - Master Database
10.20.6.30 - Slave Database

pico /etc/mysql/mysql.conf.d/mysqld.cnf

chnage the bind address to your server real ip address 10.20.6.29
bind-address            = 127.0.0.1

uncomment
server-id               = 1
log_bin                 = /var/log/mysql/mysql-bin.log

at the bottom of the file add your databases
binlog_do_db            = newdatabase
binlog_do_db            = newdatabase2

sudo service mysql restart

now log in with root on the mysql server via terminal
mysql -u root -p
GRANT REPLICATION SLAVE ON *.* TO 'slave_user'@'%' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;

copy the databases to the slave server with phpmyadmin

in 10.20.6.30 a.k. the slave
pico /etc/mysql/mysql.conf.d/mysqld.cnf

server-id               = 2
relay-log               = /var/log/mysql/mysql-relay-bin.log
log_bin                 = /var/log/mysql/mysql-bin.log
binlog_do_db            = newdatabase
binlog_do_db            = newdatabase2

sudo service mysql restart
CHANGE MASTER TO MASTER_HOST='10.20.6.29',MASTER_USER='slave_user', MASTER_PASSWORD='password', MASTER_LOG_FILE='mysql-bin.000001';

START SLAVE;
SHOW SLAVE STATUS\G

If there is an issue in connecting, you can try starting slave with a command to skip over it:
SLAVE STOP;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
SLAVE START;

@All rights reserved with Copyright Webleit.info 2018 by Sonik_Blast [ Site Map ] [ RSS ] [ YouTube Mp3 Downloader and converter ]