+254725682556 +254725052660 info@ziprof.co.ke
Client Area

Databases

How to Connect to Your MySQL Database Using MySQL Workbench or HeidiSQL

If you need to work with your website's database directly from your computer, rather than through phpMyAdmin in your browser, you can connect to it using a desktop database tool such as MySQL Workbench or HeidiSQL. This guide covers finding the connection details you need and setting up that connection.

What You Need Before You Connect

Before a desktop tool can reach your database, your hosting account must allow remote connections to it. If you haven't done this yet, see How to Enable Remote MySQL Access to Your Database first, and add your current computer's IP address (or your office's IP) to the allowed list.

Once that's done, gather the following before you start:

  • Your database hostname or server IP address.
  • The port (almost always 3306 for MySQL).
  • The full database username and its password.
  • The database name you want to connect to.

Finding Your Connection Details

In cPanel

  1. Log in to your cPanel account and open MySQL® Databases.
  2. Your database and username will already be prefixed with your cPanel account's username, for example cpanelusername_dbname and cpanelusername_dbuser. Use the full prefixed name, not just the part you chose when creating it.
  3. For the hostname, use your domain name or the server hostname shown under General Information on your cPanel dashboard. If you're unsure which one to use, use the server's shared IP address shown there instead.

In DirectAdmin

  1. Log in to DirectAdmin and open MySQL Management.
  2. As in cPanel, your database and username are prefixed with your account username, for example username_dbname.
  3. The hostname is usually your domain name or the server hostname shown on your DirectAdmin dashboard under account information.
If you're not sure which hostname to use, your ZIPROF welcome email includes your server's hostname and IP address. You can also check it via How to Find Your Hosting Server's IP Address and Hostname.

Connecting with MySQL Workbench

  1. Open MySQL Workbench and click the + icon next to "MySQL Connections" on the home screen.
  2. Give the connection a name you'll recognize, such as your website's name.
  3. Set Connection Method to "Standard (TCP/IP)".
  4. Enter your hostname or IP in the Hostname field, and leave Port as 3306 unless your account uses a different port.
  5. Enter your full database username in the Username field.
  6. Click Store in Vault to save the password so you aren't prompted every time.
  7. Click Test Connection to confirm it works, then click OK to save it.

Connecting with HeidiSQL

  1. Open HeidiSQL and click New in the session manager window.
  2. Set Network type to "MySQL (TCP/IP)".
  3. Fill in Hostname / IP, User, Password, and Port (3306 by default).
  4. Click Save to store the session, then Open to connect.
If the connection times out or is refused, double-check that your current IP address is still on the remote access allow list. Many networks, especially mobile data or office Wi-Fi, change your public IP from time to time, so you may need to update it again later.

For security, only allow the specific IP addresses you actually use to connect remotely, rather than opening access to all hosts. This keeps your database reachable for your own tools while keeping it closed to everyone else.