I am trying to set up a MySQL slave to use replication via SSL.

The my.cnf file contains the following:

server-id = 1012

master-host = host
master-port = port
master-user = user
master-password = password


Starting the slave fails with SLAVE STATUS showing

Master_SSL_Allowed: No

When I manually set up the slave as follows:


Everything works. Any idea what parameter I need to enter into my.cnf in order to force the slave to use SSL? The obvious choice - "master-ssl=1" did not work.

  • This is actually an exellent question because many MySQL Clients at my employer's web hosting company still try to use CHANGE MASTER TO parameters as startup options as well. Others using MySQL need to remember this change. Thank you for bringing this question to DBA StackExchange. +1 !!! – RolandoMySQLDBA Nov 4 '11 at 9:13
  • 1
    Thank you. It's not obvious from the documentation to say the least. – Oleg Barshay Nov 4 '11 at 16:45

Older versions of MySQL allow declaring the CHANGE MASTER TO parameters in my.cnf. Newer version may not. In fact, according to the MySQL Documentation concerning setting replication options in my.cnf:

Before MySQL 5.1.17, these options are silently ignored if given unless there is no master.info file. If that file exists, the MySQL server has already previously been configured for replication, so the information in the file is used instead. Because the server gives an existing master.info file precedence over the startup options just described, you might elect not to use startup options for these values at all, and instead to specify the replication parameters associated with them by using the CHANGE MASTER TO statement. See Section, “CHANGE MASTER TO Syntax”.

Beginning with MySQL 5.1.17, these options are deprecated and have no effect when mysqld is started. If they are used, an appropriate warning is written to the error log. Instead, you must use CHANGE MASTER TO to set the values corresponding to the deprecated options. These options are removed in MySQL 5.5.

Naturally, running CHANGE MASTER TO generates a master.info file, which includes master_ssl. No harm, no foul. Relying on my.cnf for older versions of mysql results in option being ignored when no master.info exists. They are no longer valid.

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.