External Database Authentication - connect to external database.

External Database Authentication - connect to external database.

par Sekar Govindaraj,
Nombre de réponses : 6

I connected external database configuration successfully. But when ever login student userid and password. 

firstname, lastname and email should empty. It will ask manually fill the details.

Not mapping firstname, lastname and email



we are using below the configuration.

Redhat Linux OS, MariaDB, Moodle 3.9.4

if any one support for me.


Moyenne des évaluations: -
En réponse à Sekar Govindaraj

Re: External Database Authentication - connect to external database.

par Emma Richardson,
Avatar Documentation writers Avatar Particularly helpful Moodlers Avatar Plugin developers
Well it sounds like you have not set up the field mapping correctly - I would start there in the database authentication settings...
En réponse à Emma Richardson

Re: External Database Authentication - connect to external database.

par Sekar Govindaraj,
i created separate database then created table name externaldata

my table filed name field mapping
t_username username --> t_username
t_password password --> t_password
t_firstname firstname --> t_firstname
t_surname surname --> t_surname
t_email email --> t_email

username and password mapping correctly.

if you have any guidelines. please share with me.
En réponse à Sekar Govindaraj

Re: External Database Authentication - connect to external database.

par Leon Stringer,
Avatar Core developers Avatar Particularly helpful Moodlers

So you have Data mapping set to something like this?

Screenshot of External Database plugin settings showing Data Mapping with field "Data mapping (Email address)" highlighted.

What's the type of the external database (for example MySQL, SQL Server, Oracle)?

En réponse à Leon Stringer

Re: External Database Authentication - connect to external database.

par Sekar Govindaraj,
Data mapping exactly. I am using external database MariaDB.
Moodle Database and Externaldata Database using MariaDB same server.
En réponse à Sekar Govindaraj

Re: External Database Authentication - connect to external database.

par Leon Stringer,
Avatar Core developers Avatar Particularly helpful Moodlers

Try connecting from the Moodle server to the MariaDB database containing the externaldata table using the details you've specified in DB name, DB user and Password on the External Database settings page (admin/settings.php?section=authsettingdb). For example if DBname is extdb and DB user is dbuser use:

mysql -u dbuser -p extdb

then run:

SELECT t_password, t_firstname, t_surname, t_email FROM externaldata  
 WHERE t_username = '<mytestuser>'

changing <mytestuser> to a valid username. This should show whether the settings in Moodle can access the expected user details.

Also, what is Update local set to for each field under Data mapping? If it's On creation and the user was created before the data mapping was configured then the mapped fields will not be read from the external database subsequently. Try changing them to On every login.

En réponse à Leon Stringer

Re: External Database Authentication - connect to external database.

par Sekar Govindaraj,
Thank you very much for your immediate support.
As of your instructions run the queries. its working fine.

Update local set for each filed under data mapping --> On every login



but still same problem. login username and password success.  But firstname, lastname and email not updated. 
image.png