PDA

View Full Version : Testing MYSQL installation


rjdineen
10-26-2008, 01:41 PM
Hello. I have installed Apache, PHP and MYSQL on my vista x32

I try to test my connection with

<?php
$host='localhost'; //host name
$username='user'; //database user name
$password='gillian'; //database password
mysql_connect($host,$username,$password) or die (mysql_error());
echo"connected<br/>";
?>

this is saved in my webdirectory and i view it in explorer with

http://localhost/test_sql.php

and i get the following

Access denied for user 'user'@'localhost' (using password: YES)

Can someone tell me where im going wrong please

do i have to sign into MYSQL first or does it not make any difference.

Sorry i am new to this DBMS

Regards

Rob

davidj
10-26-2008, 03:55 PM
try


$username = "root"
$password = ""

rjdineen
10-26-2008, 09:42 PM
Thank you David

I have tried that and i get

Access denied for user 'root'@'localhost' (using password: NO)

Regards

Rob

davidj
10-27-2008, 12:21 AM
have you set a username and password in the db

rjdineen
10-27-2008, 02:28 PM
Yes i have set a password when installing

is there another way to set password and username

davidj
10-27-2008, 03:43 PM
try your password while using root as username