Tale of two servers

Tale of two servers

by lee chadwick -
Number of replies: 3

I installed moodle on a server, and all worked well.  Now my district will not allow me to run web services off of it.  They want me to make it an sql server only, with the php package on the regular district web server.

I copied all the php files over to the new web server, and have tried to alter the config.php file to map to the sql server. 

$CFG->dbtype    = 'mysql';       // mysql or postgres7 (for now)
$CFG->dbhost    = 'moodle';   // eg localhost or db.isp.com              //
$CFG->dbname    = 'moodle';      // database name, eg moodle
$CFG->dbuser    = '';    // your database username
$CFG->dbpass    = '';    // your database password

Obviously I don't know what I am doing.  The warning page comes up saying that moodle couldn't connect to the database. 

The username and password are correct, and privileges set on the database.  I gave all privileges to the username, just to make sure.

I have tried the ip address in the place of host name.  This does not work either.  On the LAN, I just type in http://moodle and it pulls it up fine. 

Any suggestions?

 

Average of ratings: -
In reply to lee chadwick

Re: Tale of two servers

by Sebastien Jaffredo -

Firstyou need to have a mysql database ready. Check out http://moodle.org/doc/?file=install.html#database for more.

In any case once your database exists you're supposed to know 4 parameters:

- mysql database host name (for instance, mysql.example.net)

- mysql database name

- mysql database user name

- mysql database password

then you type in your data (in red only, black doesn't change) like this

$CFG->dbtype    = 'mysql';       // mysql or postgres7 (for now)
$CFG->dbhost    = 'mysql database host name';  
$CFG->dbname    = 'mysql database name';     
$CFG->dbuser    = 'mysql database user name';   
$CFG->dbpass    = 'mysql database password';  

In reply to Sebastien Jaffredo

Re: Tale of two servers

by lee chadwick -

I have a database installed, and have checked permissions on the database, and also the config file. The username, host, password, etc. is all good, as far as I can tell.   I believe my box is rejecting any communication on port 3306, the default mySQL port.  I should be able to at least telnet to that port, and receive garbage back, but all I get is connection refused. 

Any other suggestions?

In reply to lee chadwick

Re: Tale of two servers

by lee chadwick -
Never mind, I figured it out....  My server my.ini file had a line that bound it to localhost...