RESOURCES HUB
Premium
📅
Joined
Jul 22, 2025
💬
Messages
201
👍
Thanks
1,428
🏆
Points
425
📍
Location
London
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:
SSH Tunnel allows you to connect to your MySQL database through an encrypted SSH connection.
Advantages:
You need:
In the General tab, fill in:
Connection Name:
Example: Metin2 VPS
Host:
Port:
User Name:
Example: mt2 (or root)
Password:
Your MySQL password
IMPORTANT:
Host must be 127.0.0.1
NOT your VPS IP address.
Go to the SSH tab.
Check:
✔ Use SSH Tunnel
Fill in:
Host:
Port:
User Name:
Password:
Your SSH password
Click:
Test Connection
If everything is correct, you will see:
Connection Successful
Click OK and Save.
If you receive:
Access denied for user
Login into MariaDB on your server:
Then check users:
Make sure your database user exists as:
Check if MariaDB is running.
FreeBSD:
Linux:
If not running, start it.
Check:
On the server:
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
- Open Navicat
- Click Connection
- 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





