From owner-freebsd-database@FreeBSD.ORG Mon Feb 13 04:04:49 2006 Return-Path: X-Original-To: freebsd-database@freebsd.org Delivered-To: freebsd-database@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6E36816A420 for ; Mon, 13 Feb 2006 04:04:49 +0000 (GMT) (envelope-from maillist@brundoggy.com) Received: from outbound3.mail.tds.net (outbound3.mail.tds.net [216.170.230.93]) by mx1.FreeBSD.org (Postfix) with ESMTP id CCF6E43D48 for ; Mon, 13 Feb 2006 04:04:48 +0000 (GMT) (envelope-from maillist@brundoggy.com) Received: from outaamta02.mail.tds.net (outaamta02.mail.tds.net [216.170.230.32]) by outbound3.mail.tds.net (8.13.4/8.12.2) with ESMTP id k1D44jaq007876 for ; Sun, 12 Feb 2006 22:04:47 -0600 (CST) Received: from krynn.brundoggy.com ([66.222.49.214]) by outaamta02.mail.tds.net with ESMTP id <20060213040445.DDJO18752.outaamta02.mail.tds.net@krynn.brundoggy.com> for ; Sun, 12 Feb 2006 22:04:45 -0600 Received: from mdsnwikwbas08-pool26-a214.mdsnwikw.tds.net (mdsnwikwbas08-pool26-a214.mdsnwikw.tds.net [66.222.49.214]) by krynn.brundoggy.com (8.12.10/8.12.10) with ESMTP id k1D44ggK035965 for ; Sun, 12 Feb 2006 22:04:42 -0600 (CST) Date: Sun, 12 Feb 2006 22:04:41 -0600 (CST) From: "S. Greg Cuff" X-X-Sender: sgc@krynn.brundoggy.com To: freebsd-database@freebsd.org Message-ID: <20060212213438.O35939-100000@krynn.brundoggy.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Error connecting to mysql via php X-BeenThere: freebsd-database@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Database use and development under FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2006 04:04:49 -0000 Hi, I've searched and searched and am a little numb at this point. I haven't been able to find a solution to an error I am receiving when attempting to connect to a remote mysql server with a php script. Here is the ERROR: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) Background: Two servers running FreeBSD v6.0 STABLE Server1: apache-2.2.0_2, php5-5.1.1, php5-mysql-5.1.1, mysql-client-5.0.16 Server2: mysql-server-5.0.16, mysql-client-5.0.16 What I've tried: 1. Connecting via command line works fine: me@server1% mysql -h server2 -p -u me Enter password: Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 64 to server version: 5.0.16 Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql>quit; 2. Connecting via php (error above): $host='server2'; $user='me'; $passwd='mypassword'; $cn = mysql_connect("$host", "$user", "$passwd"); if(!$cn) { die(mysql_error()); } I am assuming the reason the /tmp/mysql.sock file doesn't exist on server1 is because mysql is not running on this server. Thanks in advanced, Greg