Setting Up SSH for Database Connection

Hi -
We have a Magento Cloud deployment and I’ve confirmed that I can connect to the MariaDB Database via DBeaver using an SSH Tunnel and a Private Key File generated as RSA (.ppk).

When I attempt to upload the file it says format not supported. Any thoughts?

Hi Adam,

See this topic: SFTP doesn’t recognise private key

Hi @dgudkov - Sorry for the slow response.

I setup a test environment to replicate this with a Sample DB in Digital Ocean.
*I’m attaching screenshots as I’m going to blow this sample away once I figure out how to execute

Steps:
I have the connection setup and successful
image

Now that I can connect to the environment I want to access the Database behind it. I can do this in a SQL client because we define that its a SSH connection. However I’m struggling with how to achieve this in EasyMorph

With the screen below, of course my machine’s local is not the host but i’m not sure how to get around that piece. Any advice?
image

Hi Adam,

SSH connector is for connecting to a remote server through SSH (SSH command action), SCP or SFTP (File transfer action).

Here are some tips on how to connect to MySQL with an SSL certificate. I’m not sure if the following will work with MariaDB, but it’s worth a try.

First, you have to convert the certificate to a PFX / PKCS#12 format and put it in a file or add it to a Windows certificate store.

Then you’ll have to add some additional properties on the “Custom properties” tab of the MySQL connector.

For a file-based certificate:

SslMode=Required
CertificateFile=full path to a certificate file
CertificatePassword=certificate password

For a store-based certificate:

SslMode=Required
Certificate Store Location=CurrentUser
Certificate Thumbprint=thumbprint (something like 479436009a40f3017a145cf8479e7694d7aadef0)

Certificate Thumbprint is optional and should be added in case correct certificate can’t be autodetected.

EasyMorph internally use MySQL Connector/NET for it’s native MySQL connector. Please refer to the following documentation page for details: https://dev.mysql.com/doc/connector-net/en/connector-net-tutorials-ssl-pfx.html

Please have in mind that EasyMorph use a version of Connector/Net which doesn’t support PEM Certificates so documentation page about PEM Certificates is not applicable to EasyMorph.

The other option for connecting to MariaDB with SSL certificate is to use ODBC driver and ODBC connector.

Hi Dmitry

I am trying to set up SSH connector.
Could you please give me some advise.

  1. Converted Pem to OpenSSH
  2. Add all credentials
  3. Error msg: Permission denied (publickey)

If I use the credentials on command line and go to phpMyAdmin I can connect.

Thanks

Hi Rykie,

can you please post a screenshot of the error? Preferrably with the screen around it.

Thanks, Dmitry. I worked it out. It was permissions. I got the webadmin to assign me the correct permissions. Also they made a few changes and now I can connect directly and do not have to use ssh connection. Rykie

1 Like