How do I connect to MySQL from my own computer?

This page is showing a generic answer.
To see a more detailed answer customized for you, type your domain name here:

Unless you choose a special option for your database, we disable remote connections to MySQL for security reasons. That means you can only connect to your MySQL database using a script on your website, or the phpMyAdmin program, or the command line on our servers.

This works just fine for almost all databases, and makes your database more secure. (Older versions of MySQL had several security problems that allowed anyone who could make a connection to have full access to a database, even without a password. Disabling remote access to your database makes sure that if a similar security bug is discovered in the future, your database will still be secure.)

A small number of users may need to connect to their database using software running on their own computer. You can use the account management control panel to enable remote connections if you wish to do this.

How do I enable remote connections?

Be sure your database has a strong password.

Be sure your database has a strong password before enabling remote connections. If you don’t, any hacker who can guess your password will be able to modify it remotely.

(Looking for a strong random password? Try QM3dx7xdnjXTK6Wn.)

If you’re creating a new database, just check the Allow connections from any computer on the Internet box.

To add remote connections to an existing database:

  1. Login to our “My Account” control panel (having trouble?)
  2. Click MySQL Databases
  3. Locate the database you wish to modify and click Change
  4. Check the Allow connections from any computer on the Internet box
  5. Click Save

What settings do I use to connect remotely?

To connect to the MySQL server from your own computer, you will need to use a special server address, or "hostname", which is different from the address you use when connecting from a script. The special hostname is simply your website address, such as example.com.

The other connection settings — username, database name, and password — should be the same as you would use to connect from a script on your website. The exact settings to use are shown under "Connecting from other locations" when you view the database connection settings.

Are there any restrictions on remote connections?

Please keep in mind that in the unlikely event a new security problem in MySQL is discovered, we may be forced to disable all remote connections to MySQL to protect your database. You shouldn't absolutely rely on remote access always being available.

How secure are remote connections?

Unfortunately, remote access to MySQL is not very secure. When your remote computer first connects to your MySQL database, the password is encrypted before being transmitted over the Internet. But after that, all data is passed as unencrypted "plain text". If someone was able to view your connection data (such as a "hacker" capturing data from an unencrypted WiFi connection you're using), that person would be able to view part or all of your database.

In particular, never store any sensitive data such as credit card numbers in unencrypted format within the database. Such data should always be encrypted, even if it's never going to be transmitted over the Internet. Encrypting the data will ensure that it stays confidential even if the raw database file is ever stolen or compromised.

Does this change anything else about my website?

One other thing to keep in mind is that enabling MySQL remote connections can cause the IP address of your website to change if you don’t have a dedicated IP address. This is necessary because only certain IP addresses on our network allow MySQL connections at the firewall level.

This should not cause any trouble or any noticeable difference, provided you haven’t hardcoded the IP address into any other system, which we never recommend anyway. If you use our DNS nameservers (like most customers), or if you’ve mapped your site to a CNAME DNS record (as we recommend for all other customers), we’ll automatically update the DNS IP address as necessary.