MySQL problem - can't connect except as localhost

MySQL problem - can't connect except as localhost

by Ian Moore -
Number of replies: 2
Hi, I've got moodle running on a Win2k server & everything work if I access it from the local machine, but I can't access it from any other clicent because all the links point to localhost.
When I set the dbhost in config.php to the machine's ip address or host name instead of localhost, it can't connect to the database anymore.
I've tried telneting to port 3306 on the server & I get a response if I use the hostname localhost, but if I use the ip address or it's hostname, I just get connection refused.
Unlike a previous post in this forum, I've checked my.ini - I have the servers ip address in the bind-address parameter.
Evidently something is blocking access to mysql but I can't figure out what.

Cheers,
Ian
Hamilton Secondary College

Average of ratings: -
In reply to Ian Moore

Re: MySQL problem - can't connect except as localhost

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
The setting for dbhost is different to the setting for wwwroot.

If the mysql server is running on the same server as Moodle, then use "localhost" for the dbname.

For web access you need to change $CFG->wwwroot to contain the hostname (or IP address).
In reply to Martin Dougiamas

Re: MySQL problem - can't connect except as localhost

by Ian Moore -
Thanks,
I was changing both entries. The wwwroot entry fixed the problem.

Cheers,
Ian