Expose Your Local MariaDB to the Internet with cpolar and Navicat
Learn how to install MariaDB on Windows, test local connections with Navicat, set up cpolar to create a TCP tunnel, obtain a public address, and configure a fixed TCP port for stable remote access to your MariaDB database from anywhere.
1. Configure MariaDB Database
1.1 Install MariaDB
Download the Windows version of MariaDB from the official website https://mariadb.com/downloads/community/ and run the installer. During installation set a password, and if MySQL already occupies the default port, change MariaDB’s port or uninstall MySQL.
After installation, a password‑setting screen appears. Adjust the port if necessary.
1.2 Test LAN Remote Connection
Use Navicat to test the local connection. If the test succeeds, the LAN connection is working.
LAN connection test successful.
2. Intranet Penetration (Port Forwarding)
To make the database accessible from the public internet, use cpolar to create a TCP tunnel that maps the local MariaDB port to a public address.
2.1 Create Tunnel Mapping
cpolar website: https://www.cpolar.com/
Download the Windows installer from the cpolar website and install it with default settings.
Start cpolar (or open http://127.0.0.1:9200) and log in with your cpolar account. If you do not have an account, register for a free one on the cpolar website.
After logging in, go to the Dashboard → Tunnel Management → Create Tunnel and set up a TCP tunnel pointing to the local port 3306.
Tunnel name: any unique name
Protocol: tcp
Local address: 3306
Domain type: free random domain
Region: default China top
Click “Create”.
After creation, the tunnel list shows a generated public address. Copy this address.
2.2 Test Random Public Address Remote Access
Open Navicat, enter the public TCP address (e.g., 3.tcp.cpolar.top) and port 11241, then test the connection. A successful test confirms remote access.
3. Configure Fixed TCP Port Address
The random tunnel address changes every 24 hours. To obtain a stable address, reserve a fixed TCP port (requires a professional cpolar plan).
Note: Configuring a fixed TCP port address requires upgrading cpolar to a professional‑level subscription.
3.1 Reserve a Fixed Public TCP Port Address
Log in to the cpolar web console, go to “Reserve”, choose “TCP address”, select the “China VIP” region, and add a description.
Region: China VIP
Description: custom remark
Click “Reserve”.
After reservation, a fixed public address is generated. Copy it for later use.
3.2 Configure Fixed Public TCP Port Address
Visit the cpolar dashboard at http://127.0.0.1:9200, open Tunnel Management → Tunnel List, locate the MariaDB tunnel, and click “Edit”.
Change the tunnel type to “Fixed TCP Port” and paste the reserved TCP address.
Port type: Fixed TCP port
Reserved TCP address: (paste the address)
Click “Update”.
After updating, the tunnel list shows the new fixed public address.
3.3 Test Fixed Public Address Remote Access
Open Navicat again and connect using the fixed TCP address. The connection should succeed, confirming stable remote access to the MariaDB instance.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
