I want to set up replication on mysql.
I replaced the contents of the my.ini file in the slave with the following contents:
[mysqld]
log-bin = mysql-bin
server_id = 2
server-id = 2
innodb_flush_log_at_trx_commit = 1
sync_binlog = 1
replicate_do_db = replica
I don't know, the correct "server_id" or "server-id", so I wrote both of them. Then I save and I restart my mysql. Then I check with the command: show variables like 'server_id' then the output appears:
+ --------------- + ------- +
| Variable_name | Value |
+ --------------- + ------- +
| server_id | 1 |
+ --------------- + ------- +
I'm confused, why is the result 1? Then I try again with the command: show variables like 'server-id' then the output appears: Empty set (0.00 sec)
The questions are:
Which one is correct: "server_id" or "server-id"? (because I've tried both of them still can't)
why after I save the my.ini file with the above settings, the server_id variable remains unchanged?
note: I have run the "stop slave" command -> "start slave" then "reset master", but the results remain the same.