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

When running a command like:

mysql -u mysql -h

mysql is connecting using the eth0 interface. How do I ask it to use the eth1 interface which has a different IP address than eth0.


share|improve this question

migrated from Dec 14 '09 at 7:03

This question came from our site for professional and enthusiast programmers.

You'll like my related question:… – kolypto Dec 15 '09 at 0:44
up vote 5 down vote accepted

Set a routing rule so that connections going to the network where resides goes through eth1 rather than the default at eth0.

Try "route --help" to see the description of how to add a route. You'll likely need root/admin access to set up the routing rule.

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.