RE: [PHP] MySQL Connect Problem

From: Date: Wed, 17 Mar 2004 20:03:13 +0000
Subject: RE: [PHP] MySQL Connect Problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-180729@lists.php.net to get a copy of this message
Hi Adam, > What happens when you try to use the "mysql" client on the > web machine, to connect to the production database server? It works: bash-2.05# pwd /usr/local/mysql/bin bash-2.05# ./mysql -h 192.168.1.44 -u web -P 3306 -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 41999 to server version: 3.23.54-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> > Does it work? If yes, what lines are you using to connect to > your DB with PHP? $DBhost = "192.168.1.44:3306"; $DBuser = "web"; $DBpwd = "user"; $DBreg = "registration"; $DBconf = "config"; $dbh = mysql_connect($DBhost, $DBuser, $DBpwd) or die("Could not connect : " . mysql_error()); mysql_select_db($DBconf) or die("Could not select database"); You notice anything wrong? Thanks, Cameron

« previous php.general (#180729) next »