Answer the question
In order to leave comments, you need to log in
mysql ssl replication not working, why?
Greetings colleagues. I decided to organize an SSL connection between the master and the slave. And now I've been fighting for half a day. So we have:
Master - 4.0.5-gentoo, mysql 5.6.26.
have_openssl YES
have_ssl YES
ssl_ca /etc/mysql/ssl-mysql/ca-cert.pem
ssl_cert /etc/mysql/ssl-mysql/server-cert.pem
ssl_key /etc/mysql/ssl-mysql/server-key.pem
Master_SSL_Allowed: No
Master_SSL_CA_File: /etc/mysql/ssl-mysql/ca-cert.pem
Master_SSL_Cert: /etc/mysql/ssl-mysql/client-cert.pem
Master_SSL_Key: /etc/mysql/ssl-mysql/client-key.pem
CHANGE MASTER TO MASTER_SSL=1
SSL error: Unable to get certificate from '/etc/mysql/ssl-mysql/client-cert.pem'
[ERROR] Slave I/O: error connecting to master '[email protected]:3306' - retry-time: 60 retries: 1, Error_code: 2026
ls -al
total 20
drwxr-xr-x 2 mysql mysql 4096 Oct 30 00:06 .
drwxr-xr-x 5 root root 4096 Nov 1 17:22 ..
-rwxr--r-- 1 mysql mysql 1229 Oct 30 13:51 ca-cert.pem
-rwxr--r-- 1 mysql mysql 1123 Oct 30 13:53 client-cert.pem
-rwxr--r-- 1 mysql mysql 1708 Oct 30 13:52 client-key.pem
Answer the question
In order to leave comments, you need to log in
In general, I figured out the problem myself.
1. Certificates must be in the old pkcs#1 format
2. Permissions for certificates and the folder where they are located must be with the user from which mysql runs, in my case it was (mysql). Even if the keys are in /etc/mysq/ssl, you still need to give the user rights. Checked like this - sudo -u mysql mysql -h 1.2.3.4 --ssl-ca=/etc/mysql/ssl-mysql/ca-cert.pem --ssl-cert=/etc/mysql/ssl-mysql/client- cert.pem --ssl-key=/etc/mysql/ssl-mysql/client-key.pem -u replica -p.
Thanks Andrey for the ask ubuntu link
, I found the answer there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question