Connecting remotely to MySQL

Overview

By default, MySQL permissions only permit same-server access for clients. This protects your database by preventing external access, but also precludes desktop database utilities like Navicat, MySQL Workbench, and Eclipse from managing your database schema.

Solution

Create a new MySQL user within the control panel under Databases > MySQL Manager.

  • Enter a user under Name
    • Remember: your newly-created user will be prefixed with your database prefix that precedes the input field
  • Enter a password under the Password field
  • Select Advanced mode
  • Enter a new host under the Host field
    • Only IP addresses are accepted
    • Use _ and % for single/multiple wildcards
      • 64.22._0.1 matches 64.22.10.1 and 64.22.90.1 but not 64.22.110.1
      • 62.22.% matches 64.22.68.1, 64.22.110.230, etc but not 64.23.110.230
      • 64.22.%.1 would match 64.22.68.1, 64.22.230.1, but not 64.22.230.2
  • Click Add User

A user has been created, but now requires database privileges:

  • Select Change Mode > List Users and Databases
  • Select the database under Edit DatabasesDatabase Name
  • Under User Privileges, select READ and WRITE
    • READ will permit the user to connect and issue SELECT statements
    • WRITE will permit INSERT, UPDATE, and DELETE
  • Click Save

Connect to the database using your server name (or domain name), and corresponding username + password previously created. Port is the default port 3306.

Leave a Reply