I have followed all the rules for replication. The steps are I have changed the my.cnf file. My db name is new_db.

server-id   = 1
log_bin = D:/xampp/mysql/mysql-bin.log
binlog_do_db = new_db

Grant the replication for slave

GRANT REPLICATION SLAVE ON *.* TO 'slave_user'@'%' IDENTIFIED BY 'password';
USE new_db;

After that the result is

| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |
| mysql-bin.000003 |      481 |              |                  |
1 row in set (0.00 sec)

Binlog_Do_DB column is empty. new_db should be there.

I don't understand what I missed. Please help to solve the problem.

  • 1
    In Windows you would need to modify the my.ini file – Craig Efrein Jun 19 '15 at 14:21

In Windows, you would need to modify the my.ini file and not the my.cnf file

Locate you my.ini file

If MySQL is being run as a service

  1. Enter "services.msc" on the Start menu search box.

  2. Find MySQL service under Name column, for example, MySQL56.

  3. Right click on MySQL service, and select Properties menu.

  4. Look for "Path To Executable" under General tab, and there is your .ini file, for instance, "C:\Program Files (x86)\MySQL\MySQL Server 5.6\bin\mysqld.exe" --defaults-file="C:\ProgramData\MySQL\MySQL Server 5.6\my.ini" MYSQL56

Otherwise the my.ini file is probably in a sub-directory of D:\xampp\mysql\

Once you've added in the binlog_do_db parameter, be sure to restart the MySQL service.

Edit by RolandoMySQLDBA

You can restart mysql from services.msc window by right clicking and choosing or you can login from DOS CommandLine as Administrator as run

C:\> net stop mysql
C:\> net start mysql

Also, make sure your settings are under the [mysqld] group header in my.ini

  • I tried it but its still the same issue. I am using xampp here. – Moumita Jun 22 '15 at 5:58
  • Hello @Moumita, it seems doubtful that you are modifying the correct my.ini file. Are you absolutely sure you are updating the right one? – Craig Efrein Jun 22 '15 at 7:58
  • One more thing I add in file. log-bin="D:/xampp/mysql/data/binlog/bin-log". – Moumita Jun 22 '15 at 9:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.