Installing and upgrading help

Error reading from database Moodle 3.5 when install

 
Picture of Gokulan N
Error reading from database Moodle 3.5 when install
 

Hi,

I tried to install Moodle in localhost using WAMP 3.1.3 64Bit. And I'm using PHP version 7.0.29, MySQL version 5.7.21 (or MariaDB 10.2.14). But I'm unable to install Moodle on this. It says "Error reading from database" when I install. Below screen shows to me. 

Can anyone please help me to fix this and install successfully???


moodle error

 
Average of ratings: -
Picture of Rick Jerz
Re: Error reading from database Moodle 3.5 when install
Particularly helpful Moodlers

I am not the expert on this, but maybe I can get you started.

Are you sure that the database is running?  Have you started Apache and MySQL in your WAMP?

Are you sure that you entered the correct database username and password?

How, or maybe a better question, did you create a database before running moodle's install?

 
Average of ratings: -
Picture of Gokulan N
Re: Error reading from database Moodle 3.5 when install
 

First thanks for your response.

Are you sure that the database is running?

Yes. I've checked that. It's working. 

Have you started Apache and MySQL in your WAMP?

Yes. Everything is running.

Are you sure that you entered the correct database username and password?

Yes. I'm sure. I've checked many times

Did you create a database before running moodle's install?

Yes. I did.


I've checked old posts for solutions. And I tried that too. But nothing works....


 
Average of ratings: -
Picture of Gokulan N
Re: Error reading from database Moodle 3.5 when install
 

And below is my config file


unset($CFG);

global $CFG;

$CFG = new stdClass();


$CFG->dbtype    = 'mysqli';

$CFG->dblibrary = 'native';

$CFG->dbhost    = 'localhost';

$CFG->dbname    = 'moodle';

$CFG->dbuser    = 'root';

$CFG->dbpass    = '';

$CFG->prefix    = 'mdl_';

$CFG->dboptions = array (

  'dbpersist' => 0,

  'dbport' => 3306,

  'dbsocket' => '',

  'dbcollation' => 'utf8mb4_unicode_ci',

);

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

$CFG->dataroot  = 'E:\\wamp64\\moodledata';

$CFG->admin     = 'admin';

$CFG->directorypermissions = 0777;

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

 
Average of ratings: -
Picture of Alain Raap
Re: Error reading from database Moodle 3.5 when install
Particularly helpful Moodlers

Could you share some information of your database logfile? Usually it gives some more information about the error you get.   

 
Average of ratings: -
Picture of Gokulan N
Re: Error reading from database Moodle 3.5 when install
 

I checked that log file. But nothing inside related to this issue. In fact, I checked all the log files. But i can't find anything related to this

 
Average of ratings: -
Picture of Alain Raap
Re: Error reading from database Moodle 3.5 when install
Particularly helpful Moodlers

Did you try dbtype "mariadb"? Can you reach the database with mysql command as root?

 
Average of ratings: -
Picture of Gokulan N
Re: Error reading from database Moodle 3.5 when install
 

I tried that too. that's not working 

 
Average of ratings: -
Picture of Alain Raap
Re: Error reading from database Moodle 3.5 when install
Particularly helpful Moodlers

drop the database and retry to install Moodle.

 
Average of ratings: -
Picture of Emma Richardson
Re: Error reading from database Moodle 3.5 when install
Documentation writersParticularly helpful MoodlersPlugin developers

I suggest trying what the message says.  Delete your database, create a new one and try again.

 
Average of ratings: -
Picture of Gokulan N
Re: Error reading from database Moodle 3.5 when install
 

Actually, i tried that. But nothing works

 
Average of ratings: -
Picture of Emma Richardson
Re: Error reading from database Moodle 3.5 when install
Documentation writersParticularly helpful MoodlersPlugin developers

What is your database server?  Let's start there - is it mysql or mariadb?

Does the user you created have the necessary permissions on the database (read,write, etc)?

That error suggests that you are connecting the database server but something is wrong with the database itself.  

Did you go through the specific instructions for whatever database you have found here: 

https://docs.moodle.org/35/en/Installing_Moodle#Create_an_empty_database

 

 

 
Average of ratings: -