MySQL

SSH Tunnel to MySQL in Private Network

This setup is done on Windows 11, using HeidiSQL. We are using a private key to SSH to the server. Make sure that you have SSH to the server at least once, and has the server is listed in ~/.ssh/known_hosts Assuming that our server is on 218.8.8.88, and our MySQL is on 10.219.80.88 (private network). Open HeidiSQL. Create a New Session: Click on the New button to create a new session. Configure the Session: Under the Settings tab: Network Type: Select MySQL (SSH tunnel) Hostname / IP: 10.219.80.88 User: Enter your MySQL username. Password: Enter your MySQL password. Port: The default MySQL port is 3306. SSH tunnel tab: Check Use SSH tunnel SSH executable: ssh.exe SSH Host + Port: Enter 218.8.8.88 (the SSH server IP) and the SSH port (default is 22). Username: Enter your SSH username. Password: Enter your SSH password or use an SSH key if you have one. Private key file: Locate your private key file Local port: 3307 Save and Connect: Click Save to save the session. Click Open to establish the connection.

<span title='2024-10-07 10:00:00 +0800 +0800'>October 7, 2024</span>
MariaDB

Running multiple instances of MariaDB

We have come across an occassion where we need to run multiple MariaDB databases on different port on the same Windows server. For our use case, each of the database represents a particular enviroment, eg. staging, sandbox or production. The same technique that I am going to illustrate will work for MySQL. Here’s how it was done. Upon installing MariaDB, we made a few copies of the data folder found in C:\Program Files\MariaDB 10.11\data, and named them:- ...

<span title='2024-07-04 13:00:00 +0800 +0800'>July 4, 2024</span>