initial error
Posted by: kvarley (---.lns10.adl2.internode.on.net)
Date: September 05, 2007 11:19AM

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"winking smiley;
mysql_select_db($database) or die( "Unable to select the database"winking smiley;
?>

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"winking smiley;
mysql_select_db($database) or die( "Unable to select the database"winking smiley;
?>

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

Options: ReplyQuote
Re: initial error
Posted by: Fedex (147.162.66.---)
Date: September 05, 2007 11:29AM

Hi ,
you need an account in your mysql I think...
Set the root pwd (if not yet) and then create your new user,

after this, try

$conn=mysql_connect("localhost", "username", "password"winking smiley;
$db = mysql_select_db("yourBD", $conn);


bye.....

Options: ReplyQuote
Re: initial error
Posted by: kvarley (---.lns10.adl2.internode.on.net)
Date: September 05, 2007 11:46AM

Thank-you eversomuch...
meanwhile checking other posts...
checked www.jlbn.net
suggested I try user 'root' and p/w ""..
I tried it and it worked...

karma to you..cheers again

Options: ReplyQuote
Re: initial error
Posted by: CyberSpatium (---.hsd1.or.comcast.net)
Date: September 09, 2007 08:10AM

read the phpmyadmin section of my manual for your answer. link to my manual is in my sig.


CyberSpatium
----------------------
WAMP English Forum Admin

I have WAMP5 working with (for development use only):
Windows Vista Ultimate x64 (64 bit)
Kaspersky Internet Security Suite 7.0.x
Spyware Terminater 2.x
CounterSpy 2.5.x


Need help? Check out my WAMP User Manual/Guide here!


Cellular Phone Deals - The Best on the Net! - FREE PHONES! Take your pick from our featured cellular phone deals by Cingular, Verizon, T-Mobile, Sprint PCS, Nextel, and more! Most of our cellular phone offers include a FREE cellular phone with FREE shipping!


Web Development for Newbie's Blog - Check out my new blog. It is for web developers, and especially tailored for the web development newbie. If you are not fluent in “geek speak”, then this incredible resource is just you. And even if you are a web development pro, this is a great resource to check out some of the latest web development tips, news, tutorials, codes and more.


Clarify Loans
Mortgage and Home Loan Advice


LaxGo Web Directory
Powerful human edited web directory of quality, spam-free sites organized via a comprehensive category structure.

Options: ReplyQuote


Sorry, only registered users may post in this forum.