Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to be able to connect to a mysql database remotely but don't know what ipaddress I would be connecting from. Either I'll be connecting over a vpn with dynamically assigned ip addresses or I'll be connecting from inside the company network.

share|improve this question
up vote 1 down vote accepted

From http://dev.mysql.com/doc/refman/5.0/en/grant.html#grant-accounts-passwords

You can specify wildcards in the host name. For example, user_name@'%.example.com' applies to user_name for any host in the example.com domain, and user_name@'192.168.1.%' applies to user_name for any host in the 192.168.1 class C subnet.

So to allow access from any IP address use user_name@'%.%.%.%'


If you haven't enabled networking to mysql you'll need to do that first: http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html

Of note (if looking at the previous link) after at least mysql server version 5.1.54 for compatibility there is no # skip-networking line only a bind-address = 127.0.0.1 line. Simply change this loop back address to the servers actual ip address and networking is enabled.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .