Database Connections: Connect to MySQL, PostgreSQL, and More
Learn how to connect DevShareHub Analytics to 12 supported databases including MySQL, PostgreSQL, MongoDB, and SQL Server.
Database Connections: Connect to MySQL, PostgreSQL, and More
Instead of uploading files every time, you can connect directly to a database. The platform supports 12 different database types. This guide explains what a database connection is, how to create one, and when to use each database type.
What Is a Database Connection?
A database connection is a link between DevShareHub and your database server. Once connected, you can:
- Browse tables and columns
- Run SQL queries (for SQL databases)
- Pull data into the platform for analysis, charts, and machine learning
- Schedule automatic refreshes
Supported Databases (12 Types)
| Database | Type | Best For |
|---|---|---|
| MySQL | SQL (relational) | Web apps, e-commerce, CMS |
| PostgreSQL | SQL (relational) | Analytics, geospatial, complex queries |
| SQL Server | SQL (relational) | Microsoft ecosystems, enterprise |
| Oracle | SQL (relational) | Enterprise, legacy systems |
| SQLite | SQL (relational) | Local apps, prototypes |
| MariaDB | SQL (relational) | MySQL alternative, open source |
| MongoDB | NoSQL (document) | Flexible schemas, JSON documents |
| Cassandra | NoSQL (wide-column) | High write throughput, distributed |
| Presto | SQL (distributed) | Big data, data lakes |
| Amazon Redshift | SQL (warehouse) | Cloud data warehousing |
| Redis | NoSQL (key-value) | Caching, sessions, real-time |
| External Storage | Distributed file system | Distributed Storage, big data storage |
When to Use Which Database
| Use Case | Recommended Database |
|---|---|
| Web application data | MySQL, PostgreSQL |
| Enterprise reporting | SQL Server, Oracle |
| Quick local analysis | SQLite |
| Flexible, nested data | MongoDB |
| Large-scale analytics | Redshift, Presto |
| Caching or sessions | Redis |
| Big data / Distributed Storage | External Storage |
| High-speed writes | Cassandra |
Creating a Connection: Step-by-Step
Step 1: Open Connections
- Go to Data Management or Connections in the Analytics sidebar
- Click New Connection or Add Database
- Select your database type from the list
Step 2: Enter Connection Details
You will need the following information (your database administrator or hosting provider can supply it):
| Field | Description | Example |
|---|---|---|
| Host | Server address (domain or IP) | db.example.com or 192.168.1.100 |
| Port | Port number for the database | 3306 (MySQL), 5432 (PostgreSQL) |
| Username | Database user name | analyticsuser |
| Password | Database password | (your secret password) |
| Database name | Specific database or catalog | salesdb |
Common Default Ports
| Database | Default Port |
|---|---|
| MySQL | 3306 |
| PostgreSQL | 5432 |
| SQL Server | 1433 |
| Oracle | 1521 |
| MongoDB | 27017 |
| Redis | 6379 |
Step 3: Optional Settings
Depending on the database type, you may see:
- SSL/TLS: Enable for secure connections (recommended for production)
- Schema: Select a specific schema (PostgreSQL, SQL Server, Oracle)
- Connection timeout: How long to wait before failing (default is often 30 seconds)
- Additional parameters: Extra connection options if your admin requires them
Step 4: Test the Connection
Before saving:
- Click Test Connection
- The platform will try to connect to your database
- You will see one of:
Step 5: Save and Name
- Give your connection a friendly name (e.g., "Production MySQL" or "Sales PostgreSQL")
- Click Save or Create
- The connection appears in your connections list
Browsing Tables and Columns
After connecting:
- Open your saved connection
- Expand the list of databases or schemas
- Expand a database to see tables
- Click a table to see its columns and types
- See which tables exist
- Check column names and data types
- Build SQL queries in the SQL Editor
- Select tables to import as datasets
Security Notes
Credentials
- Passwords are stored securely and encrypted
- Use a dedicated database user with only the permissions you need (read-only for analytics when possible)
- Do not share connection credentials in plain text (e.g., in emails or chat)
Network Access
- Your database server must allow incoming connections from the platform
- For cloud databases (AWS RDS, Azure, GCP), configure security groups or firewall rules
- Consider using a private network or VPN for sensitive data
Least Privilege
- Create a user that can SELECT (read) data but not INSERT, UPDATE, or DELETE
- Restrict access to specific databases or schemas if possible
- Review permissions with your database administrator
Troubleshooting
"Connection refused" or "Cannot connect"
- Check host and port
- Ensure the database service is running
- Verify firewall allows connections from the platform
- Verify username and password
- Ensure the user has permission to connect from your IP
- For MySQL/MariaDB, check user host restrictions (
%or specific IP)
- Confirm the database name is correct (case-sensitive on some systems)
- Ensure the user has access to that database
- Large tables may take longer
- Use the SQL Editor to run optimized queries (filters, limits, indexes)
Quick Reference
| Task | Where to Go |
|---|---|
| Create connection | Connections > New |
| Test connection | In connection form, click Test |
| Browse tables | Open connection > expand database |
| Edit connection | Connection menu > Edit |
| Delete connection | Connection menu > Delete |
What's Next?
- [Datasets Guide](datasets-guide) — Upload CSV, Excel, and JSON files
- [SQL Editor Guide](sql-editor-guide) — Write and run SQL queries
- [SFTP Files Guide](sftp-files-guide) — Connect to SFTP servers for file transfer
Related Articles
Datasets Guide: Upload, Preview, and Manage Your Data
A comprehensive guide to uploading CSV, Excel, and JSON files, configuring delimiters and encoding, previewing your data, and managing your datasets.
SQL Editor: Query Your Data with SQL
A beginner-friendly guide to SQL: what it is, how to use the SQL Editor, write your first query, and export results.
SFTP Files: Connect, Upload, and Download Remote Files
Learn what SFTP is and how to connect to SFTP servers to browse, download, and upload files in DevShareHub Analytics.
Was this helpful?