Connecting to a Database

Introduction

This tutorial will walk you through connecting to a MySQL database in DBWillow, whether it's local, remote, or behind an SSH tunnel.

Prerequisites

  • DBWillow installed
  • MySQL server running
  • Database credentials (username and password)

Local Database Connection

Step 1: Open Connection Dialog

  1. Launch DBWillow
  2. Click "New Connection" button
  3. Connection dialog appears

Step 2: Enter Connection Details

Fill in the form:

  • Connection Name: "Local MySQL" (or any name)
  • Host: localhost or 127.0.0.1
  • Port: 3306 (default)
  • Username: Your MySQL username (often root)
  • Password: Your MySQL password
  • Database: Leave empty or specify a database

Step 3: Test Connection

  1. Click "Test Connection"
  2. Wait for confirmation
  3. If successful, proceed to Step 4
  4. If failed, check credentials and server status

Step 4: Save and Connect

  1. Click "Save"
  2. Connection is saved
  3. DBWillow connects automatically
  4. You'll see the database schema

Remote Database Connection

Step 1: Gather Information

You'll need:

  • Server IP address or hostname
  • Port (usually 3306)
  • Username and password
  • Database name (optional)

Step 2: Configure Connection

  • Host: Server IP or hostname
  • Port: 3306 (or custom port)
  • Username: Remote MySQL username
  • Password: Remote MySQL password
  • Database: Optional

Step 3: Test Connection

  1. Click "Test Connection"
  2. Verify connectivity
  3. Check firewall rules if connection fails

SSH Tunnel Connection

For databases behind firewalls:

Step 1: Enable SSH Tunnel

  1. Check "Use SSH Tunnel" in connection dialog
  2. SSH configuration appears

Step 2: Configure SSH

  • SSH Host: SSH server address
  • SSH Port: Usually 22
  • SSH Username: Your SSH username
  • Authentication: Password or private key

Step 3: Configure MySQL

  • MySQL Host: Usually localhost (through tunnel)
  • MySQL Port: Usually 3306
  • Username: MySQL username
  • Password: MySQL password

Step 4: Connect

  1. Click "Test Connection"
  2. SSH tunnel establishes
  3. MySQL connection through tunnel
  4. Save connection

Troubleshooting

Connection Refused

Possible causes:

  • MySQL server not running
  • Wrong port
  • Firewall blocking

Solutions:

  • Check MySQL service status
  • Verify port number
  • Check firewall rules

Access Denied

Possible causes:

  • Wrong username/password
  • User doesn't have permission
  • Host restriction

Solutions:

  • Verify credentials
  • Check user permissions
  • Verify allowed hosts

Timeout

Possible causes:

  • Network issues
  • Firewall blocking
  • Server overloaded

Solutions:

  • Check network connectivity
  • Verify firewall rules
  • Increase timeout in settings

Next Steps

Now that you're connected: