Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a MySql server instance in Amazon EC2. In my.cnf

If I write bind-address = 127.0.0.1 , 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
1  
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

4 Answers 4

up vote 2 down vote accepted

You could bind to address 0.0.0.0. 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 0.0.0.0, 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 http://ping.eu
  2. Copy your IP address and add it to the security-group (usually is default). Somthing like this: xxx.xxx.xxx.xxx/32
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.