[Techtalk] MySQL & PHP upgrade issues

Davis, Jennifer JDavis at JUSTICE.GC.CA
Fri Jul 12 11:56:22 EST 2002


Hi:

On the weekend I backed up my system and upgraded Slackware 8.0 to 8.1,
(really, I wiped the hard disk & reinstalled).  I installed PHP 4.2 from
source and MySQL 3.23.51 from the MySQL binaries from www.mysql.com.  The
problem is that PHP cannot seem to connect to MySQL from PHP.

The site I am trying to reach is below.  All I get is following error:

Unable to connect to the database server at this time

http://brain.jenn.ca/scc/output.php?term=view_entire_database&W=Y&N=Y&H=Y&or
der=Y&headnotes=with&from=1970&to=2002



Below is the snippet of code.  I have replaced my real password with the
word password.  I have tried connecting without a password

</TITLE>
<HEAD>
<BODY>
<?php

// Connect to the database server

$dbcnx = @mysql_connect("localhost","root","password");
if (!$dbcnx)
{
echo( "<P>Unable to connect to the database server at this time.</P>" );
exit();
}

//line 50

// Select the caselaw database
if (! @mysql_select_db("scc") )
{
echo( "<P>Unable to locate the caselaw database database at this time.</P>"
);
exit();
}


I'm able to enter the database from the command line no problem, I can view
the database.  For some reason, I just can't connect to the database server
from php.  I really hope this is something simple that I have overlooked,
like a permission or something like that.  Any help would be appreciated.



> Jennifer Davis
> Constitutional & Administrative Law - Droit administratif &
> constitutionnel
> Department of Justice Canada - Ministère de la Justice du Canada
> *(613) 957-4963 - fx (613) 941-1937
> *jdavis at justice.gc.ca
> 



More information about the Techtalk mailing list