Connecting to MySQL from your own computer

By default, databases only accept connections from the server itself. That is deliberate: it means a stolen password is useless to someone outside. You can allow remote access if you need it.

Allowing your address

In cPanel open Remote MySQL and add your own IP address. Find it by searching for "what is my IP".

The catch

Most home and small office connections have an address that changes. When yours changes, the access stops working and you have to add the new one. That is not a fault.

Never use the wildcard

Remote MySQL will accept % as an address, meaning "anywhere in the world". Do not do this. It exposes your database to every automated password-guessing attempt on the internet, permanently. If you find % in that list, remove it.

Connection details

  • Host – your domain name, or the server hostname
  • Port – 3306
  • Username and password – the database user, not your cPanel login

A safer alternative

If you have SSH access, tunnel the connection through it rather than opening the database port at all. Your database client connects to a local port which is forwarded over the encrypted SSH session. Nothing is exposed publicly and it works from any address.

For occasional use

If you only need to look at the data now and then, phpMyAdmin in cPanel avoids all of this.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Managing your MySQL databases

Everything to do with databases is in cPanel, in two places: MySQL Databases for creating and...

How databases and database users are named

Database and user names are always prefixed with your cPanel account name and an underscore. You...

Creating a database and a database user

An application needs two things: a database to store data in, and a user with permission to use...

Using phpMyAdmin without breaking anything

phpMyAdmin, in cPanel, gives you direct access to your data. That is useful and it is also the...

Importing a large database

phpMyAdmin has an upload size limit, and a large database import will fail part-way through...