Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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 IP on eth0 and another IP on another interface

How do I enable remote mysql calls on eth0 device?

share|improve this question
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

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, 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 (

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

share|improve this answer

you can use :

iptables -A INPUT -p tcp --dport 3306 -d -i eth0 -j ACCEPT
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.