Matt P
Matt P

Reputation: 593

Error installing Moodle 3.0

I am unable to complete Moodle installation. I am hosting the site on NearlyFreeSpeech and using PHP 5.6. Moodle doesnt seem to be able to connect to the database and write any tables.

I created the moodledata folder in /protected/moodledata and moodle is in /public/moodle

I receive this error after accepting the terms and conditions.

Error reading from database

More information about this error

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.

Upvotes: 0

Views: 5239

Answers (2)

Areeb Soo Yasir
Areeb Soo Yasir

Reputation: 638

The only time I've seen that error is when using the wrong MySQL version. Eg currently MySQL 5.5 is supported but if you have 5.1 you would get that error.

Source: http://realtechtalk.com/moodle_install_error_Error_reading_from_database_-2072-articles

Upvotes: 0

Tim
Tim

Reputation: 807

Normally my first instinct would point to the config.php file but if it's getting as far as telling you that a connection is established with the database but there's a read error ("Error reading from database"), then that generally means your config.php file is probably healthy, but your database is not.

Firstly, check that you're using one of the following database servers that Moodle is compatible with (minimum version)

PostgreSQL 9.1 MySQL 5.5.31 MariaDB 5.5.31 Microsoft SQL Server 2008 Oracle Database 10.2

source.

Secondly, ensure that the user assigned to access your database in config.php has ALL PRIVILEGES set on that database.

Moving on... If this is a fresh install and you have no data to lose, your best bet is to start with a clean database.

You can either delete your existing database and set up a new one, or you can drop all tables from your existing database.

Option 1. Delete your existing database.

  1. Delete your config.php file
  2. Jump to phpMyAdmin (from the 'actions' tab on the MySQL process page)
  3. Click on "Databases"
  4. Delete your existing database
  5. Hit "Create database" to generate a fresh, empty database
  6. Go to http://your.url/install.php and follow the instructions for a fresh install.

Option 2. Clear your existing database

Jump to phpMyAdmin and run the following query:

DECLARE @sql NVARCHAR(max)=''

SELECT @sql += ' Drop table '+TABLE_SCHEMA+'.'+ TABLE_NAME
FROM   INFORMATION_SCHEMA.TABLES
WHERE  TABLE_TYPE = 'BASE TABLE'

Exec Sp_executesql @sql 

source.

Then go to http://your.url/install.php and follow the instructions for a fresh install.


If you managed to start with a fresh database and you get the same error, please ensure that you have all the prerequisites available from your host. You can find a list of Moodle PHP requirements here.

Upvotes: 1

Related Questions