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.

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
add comment

1 Answer

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? –  JavierMartinez 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? –  JavierMartinez Jun 30 '12 at 14:19
So you don't have the server in LAN. –  JavierMartinez Jun 30 '12 at 14:35
show 7 more comments

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.