Moodle could not connect to the database -- but everything checks out...

Moodle could not connect to the database -- but everything checks out...

Thomas Robb發表於
Number of replies: 3
Does anyone have any more ideas on how I might get my new server working? I'm using debian linux with Moodle 1.4.3. This isn't a new installation, but rather a port of my current set-up to a more powerful machine. I'm getting that infamous "Moodle could not connect to the database" when I try to connect.

I moved everything over to the new server by creating tar archives of 1) the Moodle code, 2) the moodledata folder, and 3) the mysql database in /usr/mysql

I moved these over to the new server, untarred them, put them in the right locations and fixed the permissions so that they were identical to those of the old machine.

MySQL *is* working and phpmyadmin works normally. I can view all of the tables in the 'moodle' database with The Moodle config.db file has the same specification for the database name ('moodle'), the database user ('root') and the database password ('xxxxx') that I am using to access via phpMyAdmin.

Any ideas on what else I can try?? Does anyone know how I can find out exactly what is causing Adodb to trip up?? There don't seem to be any log files anywhere that would have useful info -- or are there?
評比平均分數: -
In reply to Thomas Robb

Re: Moodle could not connect to the database -- but everything checks out...

Mike Helmick發表於
I am having the exact same problem.
I think it might be a mysql version problem

I'm running mysql version ->
mysql  Ver 14.7 Distrib 4.1.10, for apple-darwin7.7.0 (powerpc)

on Apache 2 / Mac OS X

don't have a solution, but at least you're not alone in your problem.
In reply to Mike Helmick

Re: Moodle could not connect to the database -- but everything checks out...

Tom P發表於
I have the exact same problem. I am trying to install moodle on a Mac OS 10.3.8 machine and install.php tells me it can't connect to the mysql (4.1.8) database I have set up. I know PHP4 is working so I know its not my fault. I read elsewhere on the moodle site that the problem is due to the fact that on MySQL version 4.1 or higher, the default password hashing algorithm is incompatible with that available in PHP versions 4.x.

The MySQL site has info on how to work around this problem:
http://dev.mysql.com/doc/mysql/en/old-client.html

I am going to try it next week and see if it works.
In reply to Tom P

Re: Moodle could not connect to the database -- but everything checks out...

bernie t發表於

I had the same problem and Tom's post above is exactly what I did to fix it.

Just for future reference, Tom's solution also fixes a problem some of you may have when connecting Dreamweaver with a MySQL installation.

Here's the important part of the above link:

Change the password type for your MySQL user to an OLD_PASSWORD type by logging into mySQL as root and typing in the following:

SET PASSWORD FOR 'moodleuser'@'localhost' = OLD_PASSWORD('newPassword');

All six apostrophees are required (heh...it took me forever to figure out which items were part of the syntax and which were place holders).