waiting_for_OSX
Registered
I've enabled php in httpd.conf, copied php.ini.default to php.ini, and it works fine with
<?php phpinfo(); ?>
However, when I attempt to connect to the running MySQL 5.1.38 database ( installed today, 64 bit version ) via php, I get an "unable to connect" error from this code:
<html>
<head>
<basefont face="Arial">
</head>
<body>
<?php
// set database server access variables:
$host = "localhost";
$user = "root";
$pass = "mypw";
$db = "mydb";
// open connection
$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");
// select database
mysql_select_db($db) or die ("Unable to select database!");
etc...
I can connect using
mysql -h localhost -u root
Any suggestions would be welcome.
<?php phpinfo(); ?>
However, when I attempt to connect to the running MySQL 5.1.38 database ( installed today, 64 bit version ) via php, I get an "unable to connect" error from this code:
<html>
<head>
<basefont face="Arial">
</head>
<body>
<?php
// set database server access variables:
$host = "localhost";
$user = "root";
$pass = "mypw";
$db = "mydb";
// open connection
$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");
// select database
mysql_select_db($db) or die ("Unable to select database!");
etc...
I can connect using
mysql -h localhost -u root
Any suggestions would be welcome.