Masters database not replicating on slave after restarting client I'm trying to implement master slave replication and It's works fine with no errors, database is replicated on slave, but when I close my servers and open them again and add something in masters database it's not replicated in slave , do I have to follow these steps every time I start my server?  

Setup on Masters server

mysql&gt; GRANT REPLICATION SLAVE ON *.* TO 'repl_user'@'192.168.1.20'    
IDENTIFIED BY 'secretpassword';
mysql&gt; FLUSH PRIVILEGES;

mysql&gt; use mydb;
mysql&gt; FLUSH TABLES WITH READ LOCK;
mysql&gt; exit;


my.cnf file

[mysqld]
log-bin=mysql-bin
binlog-do-db=mydb
server-id=1
innodb_flush_log_at_trx_commit=1
sync_binlog=1


in terminal again

# service mysqld restart

mysql &gt; SHOW MASTER STATUS;

# mysqldump -u root -p mydb &gt; mydb.sql
# scp mydb.sql 192.168.1.20:/opt/


SETUP SLAVE 2 SERVER

 # vim /etc/my.cnf
 [mysqld]
 server-id=2
 replicate-do-db=mydb

 # /etc/init.d/mysqld restart
 # mysql -u root -p mydb &lt; mydb.sql

 mysql&gt;  CHANGE MASTER TO MASTER_HOST='192.168.1.10',
-&gt; MASTER_USER='repl_user',
-&gt; MASTER_PASSWORD='secretpassword',
-&gt; MASTER_LOG_FILE='mysql-bin.000002',
-&gt; MASTER_LOG_POS=107;

mysql&gt; SLAVE START;
mysql&gt; show slave status \G


Also it's is only replicating one database by dumping one database on slave server

 # mysqldump -u root -p mydb &gt; mydb.sql


How can I dump all the databases from masters to slave server?
You need to rebuild the slave from a copy of the master. So take a full dump of the master:

mysqldump -uroot -p --single-transaction --master-data=2 &gt; fulldump.sql


Restore the dump file on the slave server, reset slave and then execute CHANGE MASTER again. Make sure to remove replicate-do-db or any replication filters on slave my.cnf.