Localhost error, Database connection error (2): Could not connect to MySQL

Hi everyone!

I am working on a Joomla! 2.5 video training course. I had been going along with the videos smoothly until one day I went to http://localhost and instead of seeing my usual Joomla! Home screen, Instead I was greated by the message; “Database connection error (2): Could not connect to MySQL.” I am using the XAMPP stack on my computer running Windows 8 Pro.

In my Xampp folder, htdocs folder, in my Configuration.php file, these are my settings (as directed in my video course, setting recommendations):

      public $dbtype = 'mysql';
public $host = 'localhost';
public $user = 'root';
public $password = '';
public $db = 'Joomla25';

Then, If I Look in the ‘Logs’ Folder in My Xampp directory, I find a file titled ‘error’ within it says this:

Joomla FAILURE: Username and password do not match or you do not have an account yet.
2013-05-12 05:51:22

So… I am wondering if anyone could help me to figure out how I can make sure my settings in my configuration.php file match up. I just don’t know what they need to match up with… something in my MySql or PhpMyAdmin folders?? I am not sure… any help is really appreciated. Thank You!

When you open http://localhost does XAMPP open? If yes or no next step is to go to your XAMPP installation folder and open xampp-control. See if Apache and MySQL are running. and check the ports. If its showing multiple ports for mysql etc even then it might not be connecting correctly.
Try going to APACHE and MySQL admin from there and see if that works.

Usually what happens is sometimes you add a new software that might use the same port and due to that, there are issues. You can manually start the ports by xampp-control and hopefully the solution should work.

Thank you. What I ended up doing is uninstalling xampp and installing wamp (which is what they use in the video course) which seemed to have a positive effect… I do believe your diagnosis was accurate however, that another program may have been interfering with the connection. I had installed Comodo free anti virus which caused all sorts of quirky behavior, including now what believe was the localhost issue. I have since unistalled that and gone back to Microsoft security essentials. That anti virus was really bad, messed with my computer’s DNS settings and prevented me from running programs. Creepy big brother type stuff. Well anyway, thank you kindly for your response, it is truly appreciated and of the highest value.

xamp give problem many time try wamp or you can reinstall xampp to.