We suppose that we have two MySQL servers where one will be master (mysql1 which IP address is 192.168.0.2) and second will be slave (mysql2 which IP address is 192.168.0.3) server. Database which we will replicate is testiranje. User which we will use is repl with password replikacija.
First we need to verify that we have install mysql server on both machine:

[root@mysql1 ~]# rpm -qa| grep mysql
mysql-5.0.77-4.el5_4.1
mysql-server-5.0.77-4.el5_4.1
mysql-devel-5.0.77-4.el5_4.1
mysql-5.0.77-4.el5_4.1
mysql-devel-5.0.77-4.el5_4.1
php-mysql-5.1.6-23.2.el5_3
mysql-connector-odbc-3.51.26r1127-1.el5
[root@mysql2]# rpm -qa | grep mysql
mysql-server-5.0.77-4.el5_5.3
mysql-5.0.77-4.el5_5.3

If we are starting from beginning you will need to add database to both server. In this case you should do next on both machine:

[root@mysql1 ~]# mysql -u root -p
Enter password:
mysql> create database testiranje;
mysql> quit;

Second solution is that you want to setup replication for some database, which is already in use. So, you should do dump database, as is is describe on this link: Backup with MySQL Than you will copy dump.sql file (this is in mine case, it can be any *.sql) to slave server, and do reverse process, also describe in previous link. After this we should add privileges to master and slave server. First we will add privileges on master server:

[root@mysql1 ~]# mysql -u root -p
Enter password:
mysql> grant replication slave on *.* to repl@192.168.0.3 identified by 'replikacija';
mysql> flush privileges;
[root@mysql2 ~]# mysql -u root -p
Enter password:
mysql> grant replication slave on *.* to repl@192.168.0.2 identified by 'replikacija';
mysql> flush privileges;

Next, we will change configuration files for master and slave server.

[root@mysql1 ~]# cat /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
old_passwords=1
log-bin=mysql-bin
server-id=1 This should be unique for any mysql server. I start from number 1.
binlog-do-db=testiranje Database I want to replicate.
sync_binlog=1
auto_increment_increment=2
auto_increment_offset=1

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

Also, we will need to change configuration files on slave server.

[root@mysql2]# cat /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
old_passwords=1
server-id=2
master-host=192.168.0.2 IP address for master
master-user=repl User for authentication.
master-password='repliciranje' Password for authentication.
master-port=3306
master-connect-retry=10
replicate-do-db=testiranje Database where I want to replicate.

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

After this we will need to start mysql services on both server.

[root@mysql1 ~]# /etc/init.d/mysqld restart
[root@mysql1 ~]# /etc/init.d/mysqld restart