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

I got two Debian 6 servers - one for web and one for the database..

How can I connect through the local area network?

On both servers I have permanently changed the hostnames


web => web-server
db => db-server

In the privileges in mysql I have set the root user to accept requests from web-server (instead of localhost) and from the web-server I connect to db-server

in my.cnf I have escaped the following line:

# bind-address      =


Warning: mysqli::mysqli(): (HY000/2005): Unknown MySQL server host 'db-server' (1)
share|improve this question

closed as off-topic by Ward, mdpc, MadHatter, Dave M, Christopher Perrin Aug 5 '14 at 18:46

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must demonstrate a minimal understanding of the problem being solved. Try including attempted solutions, why they didn't work, and the expected results. See How can I ask better questions on Server Fault? for further guidance." – Ward, MadHatter, Dave M, Christopher Perrin
If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 1 down vote accepted

Are you sure that you have in /etc/hosts ? db-server

Cause of the comments, you will have to configure your LAN first.

share|improve this answer
yes... I'm sure :) – clarkk Jun 30 '12 at 14:14
So you can do ping db-server and you get reply? – blacksoul Jun 30 '12 at 14:15
hmmm.. unknown host..? – clarkk Jun 30 '12 at 14:18
Hmmmm so that's the problem. So you have a DB server in IP1 and a HTTP server in IP2 and you want to connect from HTTP server to DB server. That's alright? – blacksoul Jun 30 '12 at 14:19
So you don't have the server in LAN. – blacksoul Jun 30 '12 at 14:35

Not the answer you're looking for? Browse other questions tagged or ask your own question.