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:
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,
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
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).
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
Hi Fatima,
Please contact our support team via live chat.
Please assist cannot set paramater
(question: 372, datasetitem: 0)
Hi,
Please contact our support team via live chat(click on the icon at right-bottom)
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.
Hi Matt,
Thanks for the feedback.We are glad to know that our article helps you solves the issue ?
Thank you, our Moodle went down today on Namecheap servers and this fixed the issue.
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 !!
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).
not solving error, now showing this error on every page
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).