Posted by:
kvarley
(---.lns10.adl2.internode.on.net)
Hi. First time on...can anyone help with an elementary question please?
Elsewhere I'm using LAMP to trial a simple shopping cart for educational purposes and it's working OK. Now I've tried to run it on WAMP on a standalone machine for remote students and am having trouble 'accessing the server'.
my initial connecting code was;
<?php
$hostname= "localhost";
$database = "test";
$user = "myusername"; (you'd expect this wouldn't work)
$pass = "mypassword"; (ditto)
mysql_connect($hostname) or die( "Unable to connect to the server"
;
mysql_select_db($database) or die( "Unable to select the database"
;
?>
to which I received the response;
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'myusername'@'localhost' (using password: YES) in C:\wamp\www\myfolder\updated ABC project\conn_video.php on line 9
Unable to connect to the server
so I changed the code to;
<?php
$hostname= "localhost";
$database = "test";
//$user = "myusername"; (remmed out)
//$pass = "mypassword"; (remmed out)
mysql_connect($hostname) or die( "Unable to connect to the server"
;
mysql_select_db($database) or die( "Unable to select the database"
;
?>
and received the response;
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\wamp\www\myfolder\updated ABC project\conn_video.php on line 9
Unable to connect to the server
I tried changing the user to ODBC and p/w to YES and received this response;
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ODBC'@'localhost' (using password: YES) in C:\wamp\www\myfolder\updated ABC project\conn_video.php on line 9
Unable to connect to the server
Question: I suspect I need to specify the default username and password. Is that correct and if so what are they?
Many thanks,
Kev, Adelaide