Enrolment Remote Database Connection failing

I cannot get the Enrolment plugin to work to connect Moodle to another remote Database system.

The two domains apparently are hosted on the same shared server.

The authentication plugin is working fine when you click Test in its Manage Authentication Plugins

But for Manage Enrolment Plugins, it is returning the following error;

Warning: mysqli_real_connect(): (28000/1045): Access denied for user ' ic13557d_chisang'@'localhost' (using password: YES) in /home/ic021827/public_html/lib/adodb/drivers/adodb-mysqli.inc.php on line 124
Could't connect :
localhost: Access denied for user ' ic13557d_chisang'@'localhost' (using password: YES)
Cannot connect the database.

I have tried to change password both in phpmysql and the config file but to no avail.
I have indicated the external domain the ip address for the remote database but still not working.

Anyone with the solution, please help me as I cannot find the solution yet!!

Kind regards


  • Dear Ross,

    Please come in.

    The two domains/websites are being hosted on the same server with the same IP address.
    The testing of the Authentication plugins is working fine and is indicating the fields for remote database using the same username, user password and database name as those for Enrolment plugins

    The result of Test settings is as follows:-

    Test authentication settings - External database
    (mysqli): SELECT * FROM moodleUser WHERE username <> 'random_unlikely_username'
    External table contains following columns:
    username, preferredName, surname, email, website

    So why is failing for Test Setting in the Enrolment Plugins?

    Raphael Chisanga
  • Hi Raphael, this is an interesting question. I'm not a Moodle user, and built this module as a proof-of-concept some years ago. I've not tested it in a while, but believe it should work.

    The issue seems to be related to database connections. Can you access command line mysql on the server in question? If so, you could use this to test your connection parameters to try and see where the problem lies.

    Let us know if this helps!

  • Could it be because I am trying to have access remote MySQL connections in cPanel shared hosting ?

    How is your suggestion of access command line mysql on the remote server from Windows desktop done? I have tried to Google but I cannot easily get what can for me in this instance.

    Any more ideas from the rest of this group?

    Raphael Chisanga
  • Nobody has come up with a solution yet!
  • I am desperately looking forward to seeing that the Moodle external database enrolment feature works.
  • The Enrolment failure is now over, I had just retype all the Database-related parameters allover again and the test went through though now it is reporting as follows:

    Test enrol settings - External database
    (mysqli): SET NAMES'utf8' (mysqli): SELECT * FROM moodleEnrolment
    External enrol table is empty.
    (mysqli): SELECT * FROM moodleCourse External course table is empty.

    At least there is progress. I just need to check if at all I am referring to the correct external enrol table.

    Kind regards
  • Hi Raphael, well done on solving this problem. I wonder what went wrong. Let us know if you run into any further issues...and sorry we weren't of more help this time around. Ross.
Sign In or Register to comment.