BIENVENUE10valid for the first month only! on all offersView plans
Skip to content
← Knowledge base

Connect to your database remotely

Retrieve host, port and credentials, then authorize your client IP in the panel.

Connect to your database remotely

Your onesubnet.com databases are reachable from the outside over a network connection. Connecting requires the correct credentials and authorization of your client IP.

Cause / The problem

A “Connection refused” or “timeout” error during connection usually comes from an unauthorized client IP, a closed port, or incorrect credentials.

Solution

  1. Retrieve the connection parameters in the panel (Settings or Overview tab):
    • Host: the server address (e.g. db-paris.onesubnet.com or an IP).
    • Port depending on the engine:
      • MariaDB / MySQL: 3306
      • PostgreSQL: 5432
      • MongoDB: 27017
      • Redis: 6379
    • Username and password: created at initialization.
    • Database name: usually that of the default user.
  2. Authorize your client IP. For security, the database only accepts explicitly whitelisted IPs. In the panel, add your public IP (visible on ifconfig.me) to the Allowed IPs or Remote hosts list.
  3. Test the connection from the command line:
    # PostgreSQL
    psql -h db-paris.onesubnet.com -p 5432 -U user -d mydb
    # MariaDB / MySQL
    mysql -h db-paris.onesubnet.com -P 3306 -u user -p mydb
    # MongoDB
    mongosh "mongodb://user:password@db-paris.onesubnet.com:27017/mydb"
    # Redis
    redis-cli -h db-paris.onesubnet.com -p 6379 -a password
  4. Use a connection string in your application. PostgreSQL example:
    postgresql://user:password@db-paris.onesubnet.com:5432/mydb?sslmode=require
  5. Enable TLS/SSL if possible (sslmode=require on the PostgreSQL side, tls=true on the MongoDB side) to encrypt traffic in transit.
  6. If the error persists, check:
    • That your IP has not changed (ISP with dynamic IP: use a dynamic DNS or authorize a range).
    • That the port is not blocked by your own firewall / ISP router.
    • That the user has rights on the database (GRANT ALL ON mydb.* TO user).

For production, prefer connecting your application and the database on the same internal onesubnet network to reduce latency.

oneSubnet

French hosting provider in Paris. High-performance game and voice servers.

SERVICES

Resources

LEGAL

All systems operational