Connect to MySQL error
Posted by: EdR57 (---.40.215.203.threembb.co.uk)
Date: May 19, 2012 11:16AM

I have installed WampServer 2.2d which consists of the following:

Apache 2.2.21
PHP 5.3.10
MySQL 5.5.20

without changing any of the default values for anything except the location of the wamp folder which is on partition D:, and I have set up a database, user and password using phpMyAdmin.

When I run testmysql.php with the appropriate details I get the following message:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'myusername'@'localhost' (using password: YES) in D:\wamp\www\testmysql.php on line 2

I am completely new to all this stuff but came across the error when trying to install Joomla. It seems I am not alone amongst Joomla users when it comes to this problem, but it is not a Joomla problem it seems. Please help if you can.

Options: ReplyQuote
Re: Connect to MySQL error
Posted by: RiggsFolly (---.as13285.net)
Date: May 21, 2012 10:35AM

You will have to change the code for testmysql.php and add in the userid and password you have setup in mysql

<?php
$link = mysql_connect('localhost','NEWUSERID','NEWPASSWORD');
if (!$link) {
die('Could not connect to MySQL: ' . mysql_error());
}
echo 'Connection OK'; mysql_close($link);
?>

Options: ReplyQuote


Sorry, only registered users may post in this forum.