Sharing database between 2 moodles error (one via PC for internal and one via r-pi for web access)

Sharing database between 2 moodles error (one via PC for internal and one via r-pi for web access)

by Steve Richards -
Number of replies: 1

Hi,

I have a moodle running nicely on an old unloved computer on my internal school network. I would like to make this accessible to students at home via the internet.

Taking some inspiration from this https://moopi.uk/ (A raspberry pi 2 running moodle) and this https://www.dataplicity.com/ (a nice bit of Python that allows a pi anywhere on an internal network communicate with the outside world)

I want to keep my current moodle as is on an internal server for use in school but another version of it to be accessible via the pi 2 running dataplicity. For this to work certain aspects need to be shared, such as the mysql server running on the 'internel' server.

Installing moodle on my pi2 and running config, when I get to the database config part I enter the database server IP address, default user 'root'. I have tried no port and port 3306. When I enter my password I keep getting the error :

"PHP Warning:  mysqli::mysqli(): (HY000/2002): Connection refused in /var/www/html/moodle/lib/dml/mysqli_native_moodle_database.php on line 79"

I've verified the username and password are correct by logging in manually to mysql using the same credentials.

Average of ratings: -
In reply to Steve Richards

Re: Sharing database between 2 moodles error (Connection refused in /var/www/html/moodle/lib/dml/mysqli_native_moodle_database.php)

by Steve Richards -
I've noticed that this error comes from a function in  mysqli_native_moodle_database.php called create_database()

As I don't want to make a new database, rather use an existing one, I'm going to try installing mysql on my pi2 and then continuing as if I am making a totally new and separate moodle. When it's completed I am going to go back into my configs and change them to share my database and data directory on my other server.