Question

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. https://www.digitalocean.com/community/tutorials/how-to-set-up-master-slave-replication-in-mysql#see-more

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


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 : https://dev.mysql.com/doc/refman/8.0/en/replication-solutions-encrypted-connections.html

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

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

  • will go through this article.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.