How to use Ruby and mysql2 gem to connect mysql database via TLS1.2 - mysql

I am having issues connecting to a mysql database over TLSV1.2, using Ruby and the mysql2 gem. The ruby script is running on Windows. I get the following error:
TLS version used does not meet minimal requirements for this server. Please use a higher TLS version and retry.
Based on some research I believe that mysql2 uses the Connector/C library (6.1.1), which seems to be built against YASSL, which only supports up to TLSV1.1. I can successfully connect via TLSV1.1, but if I restrict the connection to TLSV1.2 then I get the above error.
It seems possible to get a version built against OpenSSL, which supports high TLS versions, but I have found conflicting information on whether that is only for the commercial version, or if that is also available via the community edition. Does anyone have expertise in this area and can recommend a possible solution? Is it possible to get mysql2 and a compatible connector which works with TLSV1.2?

You are right about mysql2 using connector/c.
Not sure where the 6.1.1 version comes from. Did you mean MariaDB-connector-c-3.1.11? who's release notes advertised TLS-1.3 in the openssl version of this.
I checked the centos8 binary download from the above link and its linked against the system openssl (looking at ldd ./lib/mariadb/libmariadb.so).
As far as I know there's no community vs enterprise differentiation here.

Related

What's the best way to set up mysql given I code with WSL2?

I'm on Windows and use WSL2 for all my development. I currently have MySQL set up in WSL2, but I'd like to set up MySQL Workbench as well.
I'm unsure if I should install that in Windows and configure Workbench authentication/ports so they communicate (as indicated in this post and a few others) or would it be better practice/easier to install MySQL workbench in WSL2 (and set up support for Linux GUI apps)?
Alternatively, I could uninstall mysql from WSL2 and install it on Windows and run the server there and just connect to it in my scripts/apps that are running in WSL2.
With so many options on how to set this up, I'm unsure what to do.
Let me know if any more info is needed or if this is a bad question.

Configure iRedMail to use Mysql instaed of MariaDB on Debian 10

I have a development server with Mysql. I need mysql specifically as I have used the C++ connector API extensively in my code and this API does not work with MariaDB. I need to install a very secure, easily configurable mail server on this server and have chosen to install iRedMail. The thing is, on Buster, mysql gets replaced by MariaDB when you run the iRedMail install script.
Is there a way to configure iRedMail to run with a mysql backend?
I have tried the following tutorial:
https://docs.iredmail.org/install.iredmail.with.remote.mysql.server.html
It did not work. That is the only one I have found.

How can I upgrade TLS verion to 1.2 on MySQL

I have the MySQL version 5.7.26 that is using the TLS versions TLSv1.1. I had seen this when I had executed the command SHOW GLOBAL VARIABLES LIKE 'tls_version';. And I would like to upgrade to version TLSv1.2. Unfortunately I can't find a good tutorial site guiding me step by step on how to make this change. Can someone help me out. Thank you
P.S. I am running the server on Mac OS Catalina.
Most probably the openssl library on your system does not support tls 1.2 yet.
You can try
brew upgrade openssl

Issue with authentication plugin for MySQL Enterprise Edition

I have installed a trial of the MySQL Enterprise Edition and when connecting using the bundled Workbench software i get the following error:
Authentication plugin caching_sha2_password cannot be loaded: The specified module cannot be found
About which there i can find very little information. Most solutions return to the old authentication method, but I don't want to do that, and it doesn't seem to work anyway...
HeidiSQL gives the same error message.
Any suggestions?
I found a workaround in the HeidiSQL Github repository:
https://github.com/HeidiSQL/HeidiSQL/issues/163
I fixed by copying libmysql.dll from my last MySql install to my HeidiSQL folder.

Access error occured in Ruby 1.9 + MySQL

I can't connect mysql db with ruby1.9
OS -> Windows XP SP2
Ruby -> 1.9.1p0
dbi -> 0.4.2
dbd-mysql -> 0.4.3
MySQL API module for Ruby -> 2.7.3
DB(MySQL) -> 5.1.34-community
Because msvcrt-ruby18.dll was not found, I was not able to start this application.
What's wrong
One of the gems is looking for ruby 1.8.x probably the dbi or dbd gem. Try it with ruby 1.8.7
You might also consider the newer Ruby installer built with mingw. A tutorial on installing Ruby 1.9.1 with MySQL is available from The Ruby Installer Tutorials
One of the modules your application depends on was built for Ruby 1.8. The most likely culprit is the MySQL client binding, but it could be some other dependency being imported elsewhere in the code, as well.
Generally speaking, the support for Ruby 1.9 isn't yet all that good across most applications and 3rd-party libraries. Unless you have a very strong reason to use it, you'll probably have better luck sticking with the latest 1.8.X release.