How to Connect to a Database Using MySQL Workbench

If you are new to databases and wondering how to connect MySQL Workbench to MySQL server, don’t worry — this guide will walk you step by step. MySQL Workbench is a free tool that makes it easy to manage and interact with databases, whether it’s on your local machine, a cloud server, or AWS RDS MySQL Workbench.

Requirements Before You Start

  1. Download and Install MySQL Workbench
    Get the installer from MySQL official website.
  2. Database Access
    • Hostname or IP address of the server
    • Username (e.g., root or another user with access)
    • Password
    • Port (default is 3306, but some servers — like in cloud hosting or MySQL Workbench AWS RDS — may use different ports such as 3336)

Steps to Connect to Database in MySQL Workbench

Step 1: Open MySQL Workbench

Launch the program after installation. You will see a home screen where you can create a new connection in MySQL Workbench.

Step 2: Create a New Connection

  1. Click “+” (New Connection).
  2. Fill in the required fields:
    • Connection Name: Any name you like, just for display.
    • Hostname: The server’s IP address or domain. This will be provided in your service dashboard.
    • Port: Default is 3306, unless your provider specifies another.
    • Username: Usually root or another MySQL user account.

Note: Most servers do not allow external root connections. If you see “MySQL Workbench cannot connect to database server” or “MySQL Workbench no connection established”, you may need to log in directly on the server (e.g., via RDP or SSH) and connect locally.

Step 3: Test the Connection

  • Click Test Connection.
  • Enter your MySQL password.
  • If the test is successful, click OK to save the connection.

If you get “MySQL Workbench test connection failed” or “Cannot connect to database server MySQL Workbench”, check:

  • Correct hostname and port
  • Security groups or firewall settings
  • User permissions

Step 4: Connect and Manage Your Database

Once saved, simply click your new connection to open and manage your database. You can now:

  • Browse schemas and tables
  • Run SQL queries
  • Manage users and permissions
Outline