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.

EC2 instances have an Amazon "internal" IP address (something like 10.228.105.159) and one that can be used from the outside world (e.g. 46.137.103.122).

I used to access a MySQL database only from within the instance itself, but now need to change that. In /etc/mysql/my.cnf, I've commented out skip-external-locking, and I replaced

bind-address        = 127.0.0.1

... with the EC2 internal IP address, which got remote access working ok (with appropriate EC2 security group settings, of course). But now it can't be accessed by processes locally using a database url such as mysql://localhost/dbname.

Is it possible to both have remote access working and still use "localhost" when connecting to the database locally? If so, how? (Or do I just have to change local configurations to also use an IP like 10.228.105.159 when connecting to the MySQL db on the same host?)

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

You should just comment this line or provide 0.0.0.0, and it will bind to all addresses.

share|improve this answer
    
Yes, this worked. Thanks! –  Jonik Jun 30 '11 at 13:57
add comment

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.