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

/etc/hostname
/etc/hosts

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      = 127.0.0.1

error

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 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.

1 Answer 1

up vote 1 down vote accepted

Are you sure that you have in /etc/hosts ?

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

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