MySQL Database Replication in Fedora 21 I have a MySQL 5.6 Community Edition server running on a machine with Fedora 21 which was installed via the YUM repository. I want to enable MySQL replication on the Server, but since I am limited to one machine, I have to install two MySQL instances on the same machine. I need a complete step-by-step procedure of installing two or more MySQL server instances side by side, one to act as the Master, the other as the slave. I have tried searching on the Internet for a comprehensive procedure, but I haven't found any yet. The MySQL Official documentation didn't really help as it is OS independent, yet I want a Fedora/Linux specific installation and configuration. Other links I have tried include (not in any specific order) this and this, but to no avail. Anyone with a complete reference/procedure on how to do this?
Here is an old instructions for setting up master-master replication for windows but concept is same.
Considering you already have a 3306 instance by default you can follow below steps to setup as well (if above doesn't help)


  
  Make datadir and correct permissions:
  mkdir /var/lib/mysql3307
  chown -R mysql:mysql /var/lib/mysql3307
  Create config 
  cp /etc/my.cnf /etc/my3307.cnf (Correct relevant parameters)
  Install basic auth system / dbs: 
  mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql3307 --defaults-file=/etc/my3307.cnf
  Start mysql  mysqld_safe --defaults-file=/etc/my3307.cnf --user=mysql &amp;
  Take fulldump from 3306 instance:  mysqldump -uroot -p --all-databases --master-data=2 | gzip > backup.sql.gz
  Load it to new 3307 instance 
  zcat backup.sql.gz  | mysql -uroot -p --port=3307 --socket=/var/run/mysql/mysqld3307.sock
  Grab binary log co-ordinates from  backup: 
  zcat backup.sql.gz | head -30 | grep -i change
  Create replication user on master: 
  grant replication slave on . to 'repluser'@'%' identified by 'replpass';
  Run change master to on 3307 slave using binlogs take from  step #7: 
  CHANGE MASTER TO MASTER_HOST='localhost', MASTER_USER='repluser', MASTER_PASSWORD='replpass', MASTER_PORT=3306, MASTER_LOG_FILE='XXXX',
  MASTER_LOG_POS=XXXX;
  Start  slave on  3307.
  


You're done.