ERROR READING FROM DATABASE HELP!

ERROR READING FROM DATABASE HELP!

by Honest Phiri -
Number of replies: 3

Hello please help. Am trying to install moodle and I have reached a part where am suppose to configure the database but am running into the error below:

"It is usually not possible to recover from errors triggered during installation, you may need to create a new database or use a different database prefix if you want to retry the installation."

ENVIRONMENT: CENTOS 7.2 in  VMware on windows 10 Machine.

THINGS I TRIED:

1. I Deleted the database and recreate it.

2. I deleted the config.php file in moodle directory and run install.php again

3.change the user of config.php to mysql.

4. I changed the permission on config.php to 0777

5. checked my version of MYSQL which is 5.7.27

PLEASE HELP. I DONT KNOW WHERE AM MISSING IT.


Below is my config.php:

<?php  // Moodle configuration file


unset($CFG);

global $CFG;

$CFG = new stdClass();


$CFG->dbtype    = 'mysqli';

$CFG->dblibrary = 'native';

$CFG->dbhost    = 'localhost';

$CFG->dbname    = 'moodle_database';

$CFG->dbuser    = 'root';

$CFG->dbpass    = '****';

$CFG->prefix    = 'mdl_';

$CFG->dboptions = array (

  'dbpersist' => 0,

  'dbport' => 3306,

  'dbsocket' => '',

  'dbcollation' => 'utf8mb4_general_ci',

);


$CFG->wwwroot   = 'http://localhost/moodle';

$CFG->dataroot  = '/var/www/moodledata';

$CFG->admin     = 'admin';


$CFG->directorypermissions = 0777;


require_once(__DIR__ . '/lib/setup.php');


// There is no php closing tag in this file,

// it is intentional because it prevents trailing whitespace problems!


Average of ratings: -
In reply to Honest Phiri

Re: ERROR READING FROM DATABASE HELP!

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Try letting Moodle create the database...turn debugging on and see if it some errors show up that point you in the right direction...
In reply to Emma Richardson

Re: ERROR READING FROM DATABASE HELP!

by Honest Phiri -
Hi Emma, I did let Moodle create the database before I could create it manually plus Iam not sure if at this stage I can enable debugging Mode
In reply to Honest Phiri

Re: ERROR READING FROM DATABASE HELP!

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

You can enable debugging by adding lines to config.php but I'm not sure this has much effect during installation.

Can you tell us how you're performing the Moodle install? Is it using the browser or using the command line?

Could you include a screenshot of the error message in your reply?

Looking at the Moodle code it looks like a row is added to the database table mdl_config with name = "rolesactive" and value = 0, and value is then changed to 1 at the end of the database install so that the installation script can determine the database install has completed. If the database install hasn't completed I would expect an additional error to be reported.

Also, are you sure you have MySQL on your CentOS VM? CentOS 7 normally has MariaDB instead, in which case $CFG->dbtype should be 'mariadb'.