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