Error Help Please Access denied for user 'ODBC'@'localhost'

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Error Help Please Access denied for user 'ODBC'@'localhost'

Postby Rhianon » 01. February 2010 18:15

I have looked all over the web, and this site to try to find an answer to this question.

I'm running Vista Home Premium and have just installed XAMPP 1.7.3 . This has PHP Version 5.3.1 and MySQL client version: 5.1.41

I am simply trying to connect to the database and keep getting this error. I know I am missing something, but at this point, after two days of looking, I cannot locate the error.

Here is my connection code. I have not changed anything from the original installation information
Code: Select all
<?
$link = mysql_connect('localhost', 'root', '');
if (!$link) {
    die('Could not connect: ' . mysql_error());
}
mysql_select_db(games);
?>


Here is the error I get.

Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\isg\ierc\shuffle.php on line 174

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\xampp\htdocs\isg\ierc\shuffle.php on line 174

This being the case, I created a Username and password to my MySql Database via privileges tab in phpMyAdmin.
Database for user: Grant all privileges on wildcard name (username\_%)
All Global Privleges checked
name; rhianon, password xxx

I tried to connect again with this code:

Code: Select all
<?
$link = mysql_connect('localhost', 'rhianon', 'xxx');
if (!$link) {
    die('Could not connect: ' . mysql_error());
}
mysql_select_db(games);
?>


The username and password are *correct*

I still get this error
Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\isg\ierc\shuffle.php on line 174

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\xampp\htdocs\isg\ierc\shuffle.php on line 174
Access denied for user 'ODBC'@'localhost' (using password: NO)


So, I tried a different connection code to see if I had somehow written it wrong.

Code: Select all
$db_user       =    "rhianon";               // db user
$db_pass       =    "xxx";               // db pass
$db_host       =    "localhost";
$db          =    "games";               // db
mysql_connect($db_host,$db_user,$db_pass);
mysql_select_db($db) or die( "Unable to select database");


I get the same error using the $db_user : root with no passowrd.


Please help
Rhianon
 
Posts: 2
Joined: 01. February 2010 17:52

Re: Error Help Please Access denied for user 'ODBC'@'localhost'

Postby Wiedmann » 01. February 2010 19:34

I tried to connect again with this code:
Code: Select all
<?
$link 
= mysql_connect('localhost', 'rhianon', 'xxx');
if (!$link) {
    die('Could not connect: ' . mysql_error());
}
mysql_select_db(games);
?>


I still get this error Warning: mysql_query() [function.mysql-query]:

This code does not contain the function mysql_query().
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Error Help Please Access denied for user 'ODBC'@'localhost'

Postby Rhianon » 02. February 2010 17:01

I found the answer

I had to turn short_open_tag on in my php.ini file

Thanks for your help
Rhianon
 
Posts: 2
Joined: 01. February 2010 17:52


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 36 guests