Bobcares

Moodle Error reading from database – Quick fix!

by | Jul 11, 2020

Moodle Error reading from the database occurs when an improper Storage engine value is entered in the MySQL file.

Here at Bobcares, we have seen several causes for this error while troubleshooting Moodle issues as part of our Server Management Services for Moodle users, web hosts, and online service providers.

Today we’ll take a look at the cause for this error and see how our Engineers fix it.

 

What causes Moodle Error reading from database

Let us now take a look at what causes this error to occur.

In most of the cases, when the variable “storage_engine” deprecates, this error occurs. In MySQL 5.5.3, the storage_engine is deprecated and it is removed in MySQL 5.7.5 version.

So to avoid this issue in MySQL 5.5.3, Moodle should use “storage_engine”. Whereas in MySQL 5.5.3 superior it must use “default_storage_engine”.

This is something Moodle should have fixed by simply checking the MySQL version before calling this line.

This error can occur in many cases that include when logging into Moodle, installing, and also while upgrading moodle.

For instance, the error appears as below:

Moodle Error reading from database

 

How we fix Moodle Error reading from database

Recently, one of our customers approached us with this same error message. He received this error while installing Moodle. Let us now see how our Support Engineers resolve this error for our customers.

Initially, we opened the file: moodle/lib/dml/mysqli_native_moodle_database.php

In this file, we changed the below value,

@@default_storage_engine to @@storage_engine

This change immediately fixed the error message.

In some cases, depending on the MySQL version the values can be changed vice versa. This also fixes the issue.

[Need any further assistance in fixing Moodle errors? – We’re available 24*7]

 

Conclusion

In short, ‘Moodle Error reading from database’ can occur in many cases that include when logging into Moodle, installing, and also while upgrading moodle. Today, we saw how our Support Engineers fix this error for our customers,

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

13 Comments

  1. marko

    I have exactly the same problem but only with module quiz users can normaly participate to quiz and it works fine but when admin tries to edit the quiz or tries to participate in quiz it shows error reading from database

    Reply
    • Hiba Razak

      Hi,

      Our Experts can help you with the issue, we’ll be happy to talk to you on chat (click on the icon at right-bottom).

      Reply
    • fatima

      Please ,i have the same error with module quiz , when i tray to edit the quiz ,it shows error reading from database can you help me

      Reply
      • Hiba Razak

        Hi Fatima,
        Please contact our support team via live chat.

        Reply
  2. Kiewiet

    Please assist cannot set paramater

    (question: 372, datasetitem: 0)

    Reply
    • Hiba Razak

      Hi,
      Please contact our support team via live chat(click on the icon at right-bottom)

      Reply
  3. Matt Dodd

    You are a legend sir! Thank you so much for allowing me to finally go to bed knowing I’ve beaten this gremlin! Thank you so much.

    Reply
    • Hiba Razak

      Hi Matt,
      Thanks for the feedback.We are glad to know that our article helps you solves the issue ?

      Reply
  4. Omar

    Thank you, our Moodle went down today on Namecheap servers and this fixed the issue.

    Reply
  5. rav1968

    Saludo a todos, Mi problema es; después de actualizar del 3.9 al 4.1 cuando entro a los cursos e intento añadir una nueva tarea o modificar una existente me sale un cartel ” error al leer de la base de datos”, agradecería si me pudiesen ayudar, gracias !!

    Reply
    • Hiba Razak

      Hi,
      Our experts can help you with the issue.we will be happy to talk to you through our live chat(click on the icon at right-bottom).

      Reply
  6. asad

    not solving error, now showing this error on every page

    Reply
    • Hiba Razak

      Hi Asad,
      Our experts can help you with the issue.we will be happy to talk to you through our live chat(click on the icon at right-bottom).

      Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF