What's new

New messages New topics Systems Serverfiles 3D Models Web Scripting

[TUTORIAL] How to Use SSH Tunnel in Navicat (Secure Database Connection)

RESOURCES HUB

Premium
📅 Joined Jul 22, 2025
💬 Messages 201
👍 Thanks 1,428
🏆 Points 425
📍 Location London
🌐 Website metin2global.to
This tutorial explains how to connect to your MySQL / MariaDB database on a VPS or Dedicated server using SSH Tunnel in Navicat.


This method is recommended for:


  • Metin2 servers
  • VPS / Dedicated servers (OVH, Contabo, etc.)
  • Secure production environments



What is SSH Tunnel?​


SSH Tunnel allows you to connect to your MySQL database through an encrypted SSH connection.


Advantages:


  • No need to open port 3306 publicly
  • Encrypted connection
  • Much safer for production servers



Requirements​


You need:


  • VPS IP address
  • SSH username (usually root)
  • SSH password
  • MySQL/MariaDB username (example: mt2)
  • MySQL/MariaDB password



Step 1 – Open Navicat​


  1. Open Navicat
  2. Click Connection
  3. Choose MySQL or MariaDB



Step 2 – Configure the “General” Tab​


In the General tab, fill in:


Connection Name:
Example: Metin2 VPS


Host:
Code:
127.0.0.1


Port:
Code:
3306


User Name:
Example: mt2 (or root)


Password:
Your MySQL password


IMPORTANT:
Host must be 127.0.0.1
NOT your VPS IP address.




Step 3 – Enable SSH Tunnel​


Go to the SSH tab.


Check:


✔ Use SSH Tunnel


Fill in:


Host:
Code:
YOUR_VPS_IP


Port:
Code:
22


User Name:
Code:
root


Password:
Your SSH password




Step 4 – Test the Connection​


Click:


Test Connection


If everything is correct, you will see:


Connection Successful


Click OK and Save.




Common Problem 1 – Access Denied​


If you receive:


Access denied for user


Login into MariaDB on your server:


Code:
mysql -u root -p


Then check users:


Code:
SELECT user, host FROM mysql.user;


Make sure your database user exists as:


Code:
'mt2'@'localhost'




Common Problem 2 – Can't Connect to MySQL Server​


Check if MariaDB is running.


FreeBSD:
Code:
service mysql-server status


Linux:
Code:
systemctl status mariadb


If not running, start it.




Common Problem 3 – SSH Connection Failed​


Check:


  • Correct IP address
  • Port 22 open
  • SSH service running

On the server:


Code:
service sshd status
 

Latest posts

shape1
shape2
shape3
shape4
shape5
shape6
Top