Problem with mysql and connetion to it using php

From: Date: Wed, 03 Nov 2004 19:34:44 +0000
Subject: Problem with mysql and connetion to it using php
Groups: php.install 
Request: Send a blank email to php-install+get-14660@lists.php.net to get a copy of this message
Hi all, I am new to this newsgroup and have a question about using php with mysql. I have installed mysql 4.1.7 and php 5.0.2 with apache2 2.0.52. All the services come up ok work. I can execute php files with apache2 and I can bring up mysql and query the database. My problem is I cannot connect to the mysql database using php 5.0.2 when I test with a php file. <?php $username = "root"; $password = "bobby"; $hostname = "localhost"; $dbh = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); print "Connected to MySQL<br>"; // you're going to do lots more here soon mysql_close($dbh); ?> I get the erorr unable to connec to mysql from the php script. I don't know why I cannot connect because root does exist and I have the password bobby on it. I have heard that mysql and php do not work well with 41 char password and should be set to the old password lenght of 16. I have tried that I don't seem to connect. Does anyone have any ideas to correct this problem? What is the best way to look at errors? Thanks, Bob Courtney

« previous php.install (#14660) next »