Last updated
Common Connection String Components
- Host: server hostname or IP address
- Port: database port (PostgreSQL: 5432, MySQL: 3306, SQL Server: 1433, MongoDB: 27017)
- Database: the specific database/schema to connect to
- Username and password: authentication credentials (always URL-encode special characters)
- SSL mode: require, verify-full, disable — always use require or higher in production
- Connection timeout: how long to wait for a connection before failing
- Pool size: maximum number of concurrent connections
The Connection String Builder on TechConverter.me generates correctly formatted strings for all major databases and drivers, handles special character encoding automatically, and includes a parser that breaks down existing connection strings into their components for easy editing.
Examples
Example 1: PostgreSQL Connection String
A developer is connecting a Node.js application to a PostgreSQL database on a remote server with SSL required.
Components:
Host: db.example.com
Port: 5432
Database: myapp_production
Username: app_user
Password: P@ssw0rd#2024
SSL: require
Generated connection string:
postgresql://app_user:P%40ssw0rd%232024@db.example.com:5432/myapp_production?sslmode=require
Note: Special characters in password are URL-encoded:
@ → %40
# → %23
The builder automatically URL-encodes special characters in the password — a common source of connection errors when done manually. Without encoding, the @ in the password would be misinterpreted as the host separator.
Example 2: MySQL Connection String for Different Drivers
The same MySQL database needs connection strings in different formats for different drivers:
Database details:
Host: localhost
Port: 3306
Database: shop_db
Username: root
Password: secret
JDBC (Java):
jdbc:mysql://localhost:3306/shop_db?user=root&password=secret
Node.js (mysql2):
mysql://root:secret@localhost:3306/shop_db
Python (SQLAlchemy):
mysql+pymysql://root:secret@localhost:3306/shop_db
PHP (PDO):
mysql:host=localhost;port=3306;dbname=shop_db
Laravel (.env):
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=shop_db
DB_USERNAME=root
DB_PASSWORD=secret
The builder knows the correct format for each driver combination, eliminating the need to look up documentation for each technology stack.
Example 3: SQL Server Connection String
A .NET developer is connecting to a SQL Server instance with Windows authentication:
Components:
Server: SQLSERVER01\MSSQLSERVER
Database: HRSystem
Auth: Windows Authentication
Generated (ADO.NET):
Server=SQLSERVER01\MSSQLSERVER;Database=HRSystem;Trusted_Connection=True;
With SQL Server authentication:
Server=SQLSERVER01\MSSQLSERVER;Database=HRSystem;
User Id=hr_app;Password=SecurePass123;
Azure SQL Database:
Server=myserver.database.windows.net;
Database=HRSystem;
User Id=hr_app@myserver;
Password=SecurePass123;
Encrypt=True;
TrustServerCertificate=False;