Server Fault is a question and answer site for system and network administrators. 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 have a MySql server instance in Amazon EC2. In my.cnf

If I write bind-address = , server can starts.

But If I write bind-address = SERVER_IP, it gives Bind error.

So to connect this server remotely (because I want to use it for development in my local workspace), what should I do?

share|improve this question
Just out of curiosity, is there a reason you're running MySQL on EC2 rather than using Amazon RDS? – bahamat Jul 8 '12 at 19:31
up vote 2 down vote accepted

You could bind to address This makes MySQL listen on every IP.

BUT keep in mind that you might have to GRANT usage to the IP you are connecting from like

GRANT USAGE ON databse.table TO 'username'@'host';

Just as a small sidenote: You could use Amazon Relational Database Service if you just want to have a MySQL database in the cloud

share|improve this answer

I'll take a guess that SERVER_IP is the public (elastic?) IP of your instance. That won't work, because from the machine's point of view, you only get an address in 10/8, and that private IP address is NATed by Amazon's network into the public IP you know and love.

You'll have to set bind-address = 10.x.y.z (or, as Christopher Perrin suggests) to make it work. Remember, though, that a database server open to the world is a delicious target of opportunity...

share|improve this answer

What you should do is create a secure link between you and the database instance, as through OpenVPN or similar. OpenVPN may be overkill but it would be best. This way you can bind to its tun0 interface and not have to worry about nagging little things like getting hacked.

share|improve this answer

Just add your current IP to the security-group your server is using.

  1. Got to
  2. Copy your IP address and add it to the security-group (usually is default). Somthing like this:
share|improve this answer

Your Answer


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.