MYSQL Master/Slave Replication Error

Struggling with MYSQL Master/Slave replication.

I followed the the DigitalOcean document for setting up the MYSQL Master/Slave replication.

Both servers only allow SSH login and the SCP command to move copy the database dump required me to use my “admin” account and required me to enter my SSH passphrase.

the SQL.CNF has the require_secure_transport = on

The connection error I get from SHOW SLAVE STATUS\G is below

Last_IO_Errno: 3159 Last_IO_Error: error connecting to master ‘<replication_account_name>@<priv_ip_address>:3306’ - retry-time: 60 retries: 23

Do I need to create a SSH key for the <replication_account_name> account on both servers or is the fix something else? If so what?

Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Ryan Quinn
DigitalOcean Employee
DigitalOcean Employee badge
April 17, 2018
Accepted Answer

Your current configuration is not using SSH for it’s connections as that is not covered by the guide you followed. This guide covers the changes needed to tunnel your master/slave connections over SSH.

Right now it appears that your configuration is attempting to connect directly to MySQL on port 3306 but MySQL does not listen on the public IP by default for security reasons so it is unable to reach the other server.

Hello, Nice article about tunnelling, thanks. However, I wonder if it wouldn’t be more efficient to use Mysql ssl encryption to secure the replication ? See doc here :

I’m very curious to know which solution is faster, what are your thoughts about it ?

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Awesome thanks. I suspected as much, but was struggling to find the right article to guide me.

  • will go through this article.