Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a 10.237.49.251 IP on eth0 and another IP on another interface

How do I enable remote mysql calls on eth0 device?

share|improve this question
2  
Do you mean you want the MySQL server to listen only on a particular interface? Or do you want a MySQL client to choose a particular route to a remote server? –  Gilles Jul 14 '12 at 1:00
add comment

2 Answers

you can use :

iptables -A INPUT -p tcp --dport 3306 -d 10.237.49.251 -i eth0 -j ACCEPT
share|improve this answer
add comment

The mysqld configuration file - at /etc/mysql/my.cnf on my Linux box - has a bind-address option. This can be set to a particular IP address, like 10.237.49.251, and MySQL will then only listen on that interface (eth0).

The default (at least on Ubuntu) is to listen only on localhost, aka. the loopback interface (127.0.0.1).

Otherwise, MySQL can listen on all available ports and interfaces, which can be explicitly specified with bind-address=0.0.0.0.

share|improve this answer
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.