Moodle could not connect to the database.

Moodle could not connect to the database.

by Jens Frahne -
Number of replies: 5
Hello,

I've tried to install moodle-1.3.3.zip on Windows XP, Apache/1.3.31 (Win32) an MySQL 4.1.3-beta-nt.

When I open: http://localhost/moodle/admin/index.php these error appaers:

Error: Moodle could not connect to the database.

It's possible the database itself is just not working at the moment.

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

Database host: 127.0.0.1
Database name: moodle
Database user: root

The database details in config.php are ok. I checked these by copy und paste the detailvalues into the commandline client and get an connect without any problem.

I change line 28 from setup.php from
error_reporting(0);  // Hide errors
to
error_reporting(E_ALL);
and get then these additional error-message:

Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in C:\Programme\Apache Group\Apache\htdocs\moodle\lib\adodb\drivers\adodb-mysql.inc.php on line 326

Does anybody has an Idea to fix these problem?

TIA

Jens
Average of ratings: -
In reply to Jens Frahne

Re: Moodle could not connect to the database.

by André Krüger -
Picture of Core developers

Please edit your config.php and try

database host = 'localhost'

I have changed my config.php to your setting and have the same error. With localhost, everthing is ok. 

In reply to André Krüger

Re: Moodle could not connect to the database.

by Jens Frahne -
i changed my config.php to these values:
$CFG->dbhost    = '127.0.0.1';   
$CFG->dbhost    = 'mydns.domain.tld'
$CFG->dbhost    = '192.168.0.1';
$CFG->dbhost    = 'localhost';

but the Problem is still there.
There is no line like:
database host = 'localhost'
in my config.php.

Thanks,

Jens



In reply to Jens Frahne

Re: Moodle could not connect to the database.

by John Geilow -

If you use no password does it work?

If it does try this,

 mysql> SET PASSWORD FOR  'some_user'@'root' = OLD_PASSWORD('newpwd');

John

In reply to John Geilow

Re: Moodle could not connect to the database.

by Jens Frahne -
no password works.

OLD_PASSWORD works too.

Thanks, Jens
In reply to Jens Frahne

Re: Moodle could not connect to the database.

by Benedict Fernandez -
Try you creating a new database moodle in mysql first if you are installing for the first time.