Koozali.org: home of the SME Server

Moodle fails to connect to MySQL database

Offline kenwrites

  • *
  • 3
  • +0/-0
Moodle fails to connect to MySQL database
« on: November 28, 2013, 03:31:29 AM »
Hello all,

I just attempted to install Moodle, and the install seemed to go well, but now when I try to access it from another computer on my local network I get this error:

Quote
Error: Database connection failed.
It is possible that the database is overloaded or otherwise not running properly.
The site administrator should also check that the database details have been correctly specified in config.php

I modified the config file per the instructions in http://wiki.contribs.org/Moodle  Double-checked the dbpassword.  Also tried rebooting the server - no joy. 

In case it matters: 
  • I'm using SME Server in Server Only mode.  I'm currently only trying to test it out, so I'm only accessing it over my local network, just typing in the local IP address. 
  • SME Server is running on a Dell Optiplex 755.  Router is a Netgear N150.  Haven't modified router settings from defaults.

Any thoughts? 

-----
A note for others attempting to install Moodle for the first time:  check how to install the sm7contribs repo at http://wiki.contribs.org/SME8.0_Contribs_QA  You'll need it in order to install. 

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: Moodle fails to connect to MySQL database
« Reply #1 on: November 28, 2013, 05:49:00 AM »
kenwrites

I'm pretty sure you need to address/access Moodle with a valid domain style URL.
That URL is configured in Moodle settings & you cannot access Moodle if it is not setup correctly with the right (& valid) domain name.
So using a local IP is not likely to work.

Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline kenwrites

  • *
  • 3
  • +0/-0
Re: Moodle fails to connect to MySQL database
« Reply #2 on: November 29, 2013, 06:35:14 AM »
OK - thanks for the tip. 

I'll try to get my server set up with a domain style URL, then.  I believe dyndns now charges for their services, so I'll try to set up dynamic DNS through dnsdynamic.com. 

Will post results!

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: Moodle fails to connect to MySQL database
« Reply #3 on: November 29, 2013, 11:20:59 AM »
kenwrites

For testing purposes, you can create any domain name you want in the admin console/Configure this server option (in a valid format eg mytestdomain.com), as the main domain name for your sme server.
Then set that domain name to resolve locally in server manager Domains panel, so that it does not need to be a real domain as far as external Internet users are concerned. You just want it to be resolvable locally on your LAN for test purposes. If sme is not your LAN (proxy) gateway, then point your browser proxy at the sme server IP.

Quote
I believe dyndns now charges for their services, so I'll try to set up dynamic DNS through dnsdynamic.com

Pretty sure dyndns still allow 1 domain name for free per unique registered user, but you need to supply a credit card at registration time (it will not be charged unless you add more than 1 domain).
So you can still avail of a free dynamic domain at dyndyns.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline kenwrites

  • *
  • 3
  • +0/-0
Re: Moodle fails to connect to MySQL database
« Reply #4 on: December 08, 2013, 09:05:35 PM »
Janet,

Thanks so much for the info.  I'll keep that in mind that I can set up a test domain and have it resolve locally. 

And thanks for info on dyndns.org.  Might try that out soon. 

For now, I have dynamic dns set up through No-IP, with a different computer on my LAN updating the IP.  And it does work - that seems to have gotten Moodle up and running! 

This could be a big help.  I'm looking to get a job providing feedback on courses designed in Moodle, and it'll help to have a portfolio in Moodle.  Muchas gracias!