MySQL does not work at all
Posted by: TJ (---.dhcp.inet.fi)
Date: February 11, 2006 10:49AM

Alright, I just successfully installed Wamp 5 1.6.1 and all services are running as they should, but even the simplest test for MySQL fails immediately.

<html>
<body>
<?php
$connect = mysql_connect("localhost"winking smiley or die ("Yhdistäminen ei onnistunut" . mysql_error());
if(isset($connect))
{
print "MySQL asennettu";
}
mysql_close($connect);
?>
</body>
</html>

It shows this error:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ODBC'@'localhost' (using password: NO) in J:\web\mysql\sqtest.php on line 4
Yhdistäminen ei onnistunutAccess denied for user 'ODBC'@'localhost' (using password: NO)

Options: ReplyQuote
Re: MySQL does not work at all
Posted by: CyberSpatium (---.hsd1.or.comcast.net)
Date: February 11, 2006 10:30PM

you did not use the right format with the mysql_connect function.

[us2.php.net]

resource mysql_connect ( [string server [, string username [, string password [, bool new_link [, int client_flags]]]]] )

change it to this:

$connect = mysql_connect('localhost','root') or die ("Yhdistäminen ei onnistunut" . mysql_error());

Options: ReplyQuote
Re: MySQL does not work at all
Posted by: TJ (---.dhcp.inet.fi)
Date: February 12, 2006 01:07PM

I changed it and I still cannot connect:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: NO) in J:\web\mysql\sqtest.php on line 4
Yhdistäminen ei onnistunutAccess denied for user 'root'@'localhost' (using password: NO)

I also tried creating a new account for myself and I get an error too:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'torniojaws'@'localhost' (using password: YES) in J:\web\mysql\sqtest.php on line 4
Yhdistäminen ei onnistunutAccess denied for user 'torniojaws'@'localhost' (using password: YES)

Options: ReplyQuote
Re: MySQL does not work at all
Posted by: CyberSpatium (---.hsd1.or.comcast.net)
Date: February 12, 2006 01:59PM

DId you change your mysql pasword?

If you changed the mysql password, change your mysql_connect function to this:

$connect = mysql_connect('localhost','root','MySQL_PasswordHere') or die ("Yhdistäminen ei onnistunut" . mysql_error());

obviously, change MySQL_PasswordHere above to your MySQL password.

Options: ReplyQuote
Re: MySQL does not work at all
Posted by: TJ (---.dhcp.inet.fi)
Date: February 12, 2006 08:49PM

I haven't changed the password. I also checked it through phpMyAdmin, and there is no password set.

Options: ReplyQuote
Re: MySQL does not work at all
Posted by: CyberSpatium (---.hsd1.or.comcast.net)
Date: February 13, 2006 03:31PM

you said you tried to make a new account for yourself, but once you make a new account, you need to tell mysql what database that account has access to.

Options: ReplyQuote


Sorry, only registered users may post in this forum.