Jump to content

Error With Mysql Server


villermen

Recommended Posts

I've just installed MySQL on my computer, and got it all running now.The problem is when I try to connect to MySQL via PHP, it gives an error message.The error message given is:

Could not connect: Access denied for user 'ODBC'@'localhost' (using password: NO)PHP Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ODBC'@'localhost' (using password: NO) in [[path to file (hid it)]] on line 2

The .php file run only contains the following part from the MySQL connect tutorial:

<?php$con = mysql_connect();if (!$con)  {  die('Could not connect: ' . mysql_error());  }?>

Why and how is the acces denied?I can't find out where the problem lies, can anybody help me fixing it?Website:IIS (run from localhost)PHP 5.2.10 (run from localhost/linked to IIS/working fine/mysql extension supported)MySQL 5.1 (configured with no password and username)Gr.Villermen

Link to comment
Share on other sites

Just fill in the parameters of mysql_connect() :) it's trying to do mysql_connect("localhost", "ODBC", ""), because, if you read the manual for mysql_connect() http://www.php.net/mysql_connect it doesn't actually use "localhost:3306,no username,no password" as default, it uses values from php.ini.Try entering the correct details and seeing what happens :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...