Question

some comments preceding a mysql_connect statement are telling me to modify the values/variable name to my installation. I'm using xamp and looking in php.ini right now. don't really know where the problem is. please advise. Thanks.

php:

$dbhost = 'localhost'; //unlikely to require changing.
$dbname ='publication'; //moify these
$dbuser = 'username'; //variables 
$dbpass = 'password'; //// to your installation
$appname = 'Robot City'; // and preference

mysql_connect($dbhost, $dbuser, $dbpass) or die(mysql_error());

error message:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'username'@'localhost' (using password: YES) in C:\xampp\htdocs\ajaxpagination\testpage.php on line 10
Access denied for user 'username'@'localhost' (using password: YES)
Was it helpful?

Solution

Instead of looking into php.ini you have to look into your XAMPP documentation.
I am sure it contains database credentials you have to use.

As a wild guess try to use

$dbname ='test'; //moify these
$dbuser = 'root'; //variables 
$dbpass = '';

But again - refer to the documentation for the actual values.

There is also a chance that you entered them yourself upon the process of the XAMPP installation.

Note that I have never seen this application in my life. I am writing only out of the general idea of how most applications work.

OTHER TIPS

This has nothing to do with php.ini. You're providing the wrong username/password to mysql, or you've not configured that account properly in mysql.

What does show grants for username@localhost; show when you run that in mysql?

Wrong username and password. Period!!! Try

$dbhost = 'localhost'; //unlikely to require changing.
$dbname ='publication'; //moify these
$dbuser = 'root'; //variables 
$dbpass = ''; //// to your installation
$appname = 'Robot City'; // and preference
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top