Hi Piotr, Everyone else is suggesting edit all of the code. Alternatively you could setup an iptables rule which forwards all incoming requests on 127.0.0.1:3306 (or whatever port your mysql server is running on) to 192.168.0.1:3306 (repolace 192.168.0.1 wit the IP of your DB server). This way if your DB moves again, you change your forward rule. If, however, you try to put the PHP code on another system, you will need to either put the DB on the same system, or change the iptables ruleset for the new webserver. It's worth a shot. Matt Vos On Thu, 2004-03-18 at 03:57, Operator wrote: > Hi everyone, > > I need to put my database server on the another machine - how can I > configure system(Debian Linux)/php/mysql etc. to make it work without > changing all 'localhost' in a hundreds of customer's scripts? > > The problem is, when localhost is specified as a host the connection is made > using unix socket, not TCP (is it possible to change this?). I tried to > export the socket from database server via NFS, but with no success: > > (...) > munmap(0x2e1f2000, 4096) = 0 > rt_sigaction(SIGPIPE, {SIG_IGN}, {SIG_DFL}, 8) = 0 > socket(PF_UNIX, SOCK_STREAM, 0) = 3 > fcntl64(3, F_GETFL) = 0x2 (flags O_RDWR) > connect(3, {sin_family=AF_UNIX, path="/var/run/mysqld/mysqld.sock"}, > 110) > = -1 ECONNREFUSED (Connection refused) > shutdown(3, 2 /* send and receive */) = 0 > close(3) = 0 > (...) > > Any ideas? > > Regards > Piotr Babula