MySQL connection error

Bug #548123 reported by Mitsuhiro Yoshida
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Unassigned

Bug Description

After the follwing commit, Mahara shows MySQL DB connection error as below.

[git.mahara.org commit]
http://git.mahara.org/?p=mahara.git;a=commit;h=fc8d64fd920e1532dfe164853f8ce04f0f748cbe

[error message]
---------------------------------------------------------------------------
Mahara: Site unavailable
Mahara could not connect to the application database.

* If you are using Mahara, please wait a minute and try again
* If you are the administrator, please check your database settings and make sure your database is available

The error received was:
Missing file: /home/mahara/public_html/lib/adodb/drivers/adodb-mysql5.inc.php

This bug was imported from eduforge.org, see:
https://eduforge.org/tracker/index.php?func=detail&aid=2998&group_id=176&atid=739

Revision history for this message
Mitsuhiro Yoshida (mits) wrote :

To avoid this MySQL connection error, we need to fix
'htdocs/init.php' as below.

File: htdocs/init.php
Ref.: fc8d64fd920e1532dfe164853f8ce04f0f748cbe

[before]
// core libraries
require('mahara.php');
ensure_sanity();
require('dml.php');
require('web.php');
require('activity.php');
require('user.php');

[After]
// core libraries
require('mahara.php');
ensure_sanity();
require('dml.php');
require('ddl.php');
require('web.php');
require('activity.php');
require('user.php');

Revision history for this message
Nigel-catalyst (nigel-catalyst) wrote :

That's not how the problem will eventually be fixed - ddl was removed from init.php because it's unnecessary for more than 99% of requests, and loads eight large files.

We'll find another fix for it.

Revision history for this message
Mitsuhiro Yoshida (mits) wrote :

I see. :-)

How about this?

File: htdocs/init.php
Line: 90

[before]
ob_start();

$db = &ADONewConnection($CFG->dbtype);

[after]
ob_start();

if (is_postgres()) {
    $CFG->dbtype = 'postgres7';
}
else if (is_mysql()) {
    $CFG->dbtype = 'mysql';
}

$db = &ADONewConnection($CFG->dbtype);

Revision history for this message
Nigel-catalyst (nigel-catalyst) wrote :

This seems to have been fixed at some point.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.