error reading from database

error reading from database

by Sushant Malla -
Number of replies: 2

Hi guys, I had a live site running using moodle 3.9 but had to make some changes so decided to disable that domain and started running that site on my local computer and now that i have installed it on my localhost that is on php7.3 and moodle 3.9 and mysql  Ver 15.1 Distrib 10.4.24-MariaDB now it is not letting me login into my moodle administrator and is showing error reading from database. I have searched in the forums but cannot find any solutions. So your help would be greatly appreciated.

Thank you in advance

Average of ratings: -
In reply to Sushant Malla

Re: error reading from database

by Ken Task -
Picture of Particularly helpful Moodlers

Running from localhost would require changes to config.php.

DB server should be 'localhost' - but DB user/password is probably different.   So would wwwroot from FQDN to localhost.  And maybe path to moodledata.

Not only that, but all internal links in the DB had https://olddomain/ in them.  You must now convert all internal links to http://localhost/ assuming that one can no longer run a valid ssl cert for your localhost computer.

You've not mentioned what operating system this 'localhost' is?  Windows/Linux (what distro).

As I have not used Windows in many years, the following is linux:

From terminal, ps aux |grep mysqld

to see if mariaDB server is running.

If it is, then again from terminal, what happens when you attempt connection to the DB using the mysql client application?

mysql -u userseeninconfig.php -p'passwordseeinconfig.php'

'SoS', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Re: error reading from database

by Sushant Malla -
Thank you for your reply and sorry for not mentioning the OS I am currently on windows and I have changed all the fields dbhost ,wwwroot, dataroot and have changed all the internal links in the db.