Newbie - MySQL connection failed

Newbie - MySQL connection failed

by Hung Phan -
Number of replies: 7

Hi, everyone. This is my first post.

I try to follow the installation document to install Moodle in MS XP Pro. I have a problem when try to connect to localhost/moodle/admin. The message I received is:

Error: Database connection failed.

It is possible that the database is overloaded or otherwise not running properly.

The site administrator should also check that the database details have been correctly specified in config.php

I create a small script to test the connection between PHP and MySQL, and it failed sad.

Can someone tell me how to fix this problem? (I'm a newbie, so please be specific)

Testing system: Windows XP Pro, EasyPHP 1.7, Apache 1.3.27, PHP 4.3.3, MySQL 4.0.15, and phpMyAdmin 2.5.3

Average of ratings: -
In reply to Hung Phan

Re: Newbie - MySQL connection failed

by R Holden -

I'm getting that error too.  I just downloaded moodle 1.4.2 and am using IIS instead of apache by following these instructions:

http://moodle.org/wiki/index.php/StepByStepInstallMoodleOnIIS

(I would like to help update this file as Windows 2003 Server has a few additional steps for ISAPI permissions)

My testing system:  Windows 2003 Server, PHP 4.3.9 (manual install), MySQL 4.1.7 (installer), and IIS 6.

In reply to Hung Phan

Re: Newbie - MySQL connection failed

by R Holden -

I tried this link:

http://dev.mysql.com/doc/mysql/en/Old_client.html

And it fixed my ability to access phpmyadmin, after I filled out the config.inc.php for phpmyadmin.

* And then I created a database called 'moodle' via phpmyadmin, and reloaded the moodle page, and it worked!

In reply to R Holden

Re: Newbie - MySQL connection failed

by Steven Day -
I too just experienced this problem. Will try creating a database from phpmyadmin as see if that works, as it did for R Holden. 
In reply to Steven Day

Re: Newbie - MySQL connection failed

by R Holden -

Let me know if it works, if not, post problem here...

In reply to R Holden

Re: Newbie - MySQL connection failed

by Steven Day -
I eventually solved the problem through cpanel after realizing the db user had not been added to the new database. It looked as though it had until comparing it with a proper setup.
In reply to Steven Day

Re: Newbie - MySQL connection failed

by Tito V -
Steven,
Thanks for the solution. I also had not added the dbuser to the moodle database. Did it in phpMyAdmin:
-> Privileges ->user edit ->add privileges on the following database ->Moodle ->  GO.

That was that. Thanks again for the solution! big grin