Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.