One Database connection to other IP's

One Database connection to other IP's

by rashmi kanchagar -
Number of replies: 1

Hello Moodlers,

I have my local moodle proejct and wanna connect to server-database which has it's own IP. I configured according to the requirement in moodle/install.php and moodle/config.php. Am using mysql5.0 - phpmyadmin and not able to connect my server DB.

Can any one helpme out in ths.. And time spent on this is being increasing.. Kindly I request any one suggest me on this situation...

Advance thanks ...

 

Regards,

Rashmi Amit Kanchagar

 

 

 

Average of ratings: -
In reply to rashmi kanchagar

Re: One Database connection to other IP's

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
You mean that you the database server is on a different server to the Moodle web server? Put the IP address in $CFG->dbhost in config.php (definitely not 'localhost').

When you create the username and password you will have to be careful with the GRANT command. It needs to reflect the IP or name of the Moodle server. E.g.

GRANT ...... on moodle.* to moodleuser@192.168.1.99 .....

You also need to have networking enabled in MySQL - if it is already accessed from other machines then you won't have to worry about that. It's usually that GRANT command that's the problem with MySQL and there are some settings in my.cnf that can trip you up.

More info: http://dev.mysql.com/doc/refman/5.0/en/access-denied.html