Skip to main content
Green binary audience decorative image for WebBuild

Accessing the Database Through Sequel Pro and SSH

Learn how to securely access and manage your MySQL database on DigitalOcean using Sequel Pro with SSH.

Module 6 - Lesson 4

Accessing the Database Through Sequel Pro and SSH

Play

Why Use Sequel Pro?

Sequel Pro is an open-source macOS application that simplifies MySQL database management. With Sequel Pro, you can navigate databases, run queries, add/remove users, and perform other database management tasks through a secure SSH connection.

Download and Install Sequel Pro

  1. Visit Sequel Pro and download the application.
  2. Install and open Sequel Pro.

Setting Up an SSH Connection in Sequel Pro

To connect to your MySQL database using SSH:

  1. Open Sequel Pro.

  2. Create a New Connection:

    • Click the Standard tab and then switch to the SSH tab.
  3. Enter Connection Details:

    • MySQL Host: 127.0.0.1
    • Username: root
    • Password: Retrieve the MySQL root password from your server:
      cat /root/.digitalocean_password
    • Database: Leave blank to view all databases.
  4. SSH Details:

    • SSH Host: Your server’s IP address.
    • SSH User: root or another SSH user.
    • SSH Key: Select the private key file you created earlier, or enter the SSH password.
  5. Save and Connect:

    • Click Connect to establish the connection.
Sequel Pro setup screenshot

Once connected, Sequel Pro provides a GUI to manage your database:

  • View Tables: Browse database tables and their data.
  • Run Queries: Execute SQL queries in the query editor.
  • Manage Users: Add or remove database users and permissions.
  • Export/Import Data: Export database schemas or import SQL files.

!!!CAUTION: Be careful when modifying your database. Changes are immediate and could affect your site’s functionality.

Tips for Secure Access

  • Use an SSH key for authentication instead of passwords.
  • Regularly back up your database before making changes.
  • Limit access to the MySQL root account; use a user with restricted permissions for everyday tasks.

By following these steps, you can securely manage your MySQL database with Sequel Pro and SSH on DigitalOcean.