---
title: "Connecting remotely to MySQL"
date: "2014-12-03"
category: "mysql"
slug: "connecting-remotely-mysql"
---

This article explains how to connect to your MySQL database from an external application such as [Navicat](http://navicat.com/), [MySQL Workbench](http://www.mysql.com/products/workbench/), or [Eclipse](https://eclipse.org/pdt/).

By default, MySQL only permits connections from the server itself. To allow remote access, you need to create a user with an external host and grant it database privileges.

## Creating a Remote User

1. Open the [[logging-into-the-control-panel]] and navigate to **Databases** > **MySQL Manager**
2. Enter a username under _Name_
    - The username will be automatically prefixed with your database prefix
3. Enter a password under the _Password_ field
4. Select **Advanced** mode
5. Enter a remote host IP address under the _Host_ field
    - Only IP addresses are accepted
    - Use `_` and `%` as wildcards for single and multiple characters:
        - `64.22._0.1` matches 64.22.10.1 and 64.22.90.1, but not 64.22.110.1
        - `64.22.%` matches 64.22.68.1, 64.22.110.230, etc., but not 64.23.110.230
        - `64.22.%.1` matches 64.22.68.1, 64.22.230.1, but not 64.22.230.2
6. Click **Add User**

## Granting Database Privileges

After creating the user, assign it access to a database:

1. Select _Change Mode_ > **List Users and Databases**
2. Select the target database under _Edit Databases_ > _Database Name_
3. Under _User Privileges_, select **READ** and **WRITE**
    - **READ** permits `SELECT` statements
    - **WRITE** permits `INSERT`, `UPDATE`, and `DELETE` statements
4. Click **Save**

## Connecting

Use your [[what-is-my-server-name]] (or domain name) as the hostname, along with the username and password created above. The default MySQL port is **3306**.
