Error reading from database

Error reading from database

by Ken Henderson -
Number of replies: 4

Hi

I am fairly new to moodle and thought it was similiar to wordpress in setup and moving but there defintely are some differences.


I am working with a friend who is moving exsisting install over to my hosting on Cpanel.


I imported the database, downloaded the latest version of moodle put the old moodle files in the outside of public_html in moodle_data folder and connected it to the system

the site comes ups but when I try to login I get "Error Reading from Database"

Please advise how to troubleshoot and correct this.

thank you

Average of ratings: -
In reply to Ken Henderson

Re: Error reading from database

by Ken Task -
Picture of Particularly helpful Moodlers

Moodle, like wordpress, is dynamic and most of what you see in Moodle actually comes from the database for moodle.    Did you create a moodle DB and import an sql dump from old server into the DB for Moodle?

Then, in config.php of Moodle code change the DB info to appropriate values.   No need to reboot web service on changes to config.php ... next hit at the Moodle will pick up on the config.php changes.

IF the domain name of the site has changed as well as the protocol (http/https), you will also need to use the admin search and replace tool ... search for http(s)://oldsite/[moodle]/ replace with http(s)://newsite/[moodle]/ .... the [moodle] directory only if the old site had the code in moodle directory.

Moodles are also memory intensive ... is your server up to it?

Also, if Linux, might install mysqltuner.pl (if running mysql/mariadb).   And run it after the moodle has been up a day.   You might find tuner gives some recommendations you didn't have set for the DB server due to Moodle.

'spirit of sharing', Ken

In reply to Ken Task

Re: Error reading from database

by Ken Henderson -

Hi Ken

Thank you, Great name by the way... :0)


So I did get an old database and import it into mysql (with mysqli turned on)


I then uploaded the old moodledata folder


I then had to do a fresh install of moodle meaning I ran the installer but pointed to my old database.


I went back into the phpmyadmin and removed references to old site


The site is working until I login and then it says Error reading from database https://prnt.sc/ge8fcp

My server is a beefy 64 GB 12 Core machine and its only running a few wordpress sites on it and this moodle installastion


its good to know its like wordpress but of course its acting finnicky and theres something that it doesnt like at all. 


any more suggestions.

In reply to Ken Henderson

Re: Error reading from database

by Ken Task -
Picture of Particularly helpful Moodlers

One to begin with ... read:

https://docs.moodle.org/33/en/Moodle_migration

Sounds like the attempt to 'wing it' didn't 'fly'.   Moodle is a little more complicated than WordPress.

Also sounds like .... 'ran the installer' ... that it's Windows?  Hopefully NOT a cPanel thang or a BitNami install.   Mind describing that ... 'ran the installer' part?

'spirit of sharing', Ken


In reply to Ken Henderson

Re: Error reading from database

by Rahul Rai -

Hi Ken 

I hope you using latest version database.

If not please upgrade your MySQL.

If it does not work, please let me know.