External Database Authentication - connect to external database.

External Database Authentication - connect to external database.

дэргэд Sekar Govindaraj -
Хариу нийтлэлийн тоо: 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.


Үнэлгээний дундаж: -
Sekar Govindaraj-н хариуд

Re: External Database Authentication - connect to external database.

дэргэд Emma Richardson -
Documentation writers зураг Particularly helpful Moodlers зураг Plugin developers зураг
Well it sounds like you have not set up the field mapping correctly - I would start there in the database authentication settings...
Emma Richardson-н хариуд

Re: External Database Authentication - connect to external database.

дэргэд 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.
Sekar Govindaraj-н хариуд

Re: External Database Authentication - connect to external database.

дэргэд Leon Stringer -
Core developers зураг 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)?

Leon Stringer-н хариуд

Re: External Database Authentication - connect to external database.

дэргэд Sekar Govindaraj -
Data mapping exactly. I am using external database MariaDB.
Moodle Database and Externaldata Database using MariaDB same server.
Sekar Govindaraj-н хариуд

Re: External Database Authentication - connect to external database.

дэргэд Leon Stringer -
Core developers зураг 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.

Leon Stringer-н хариуд

Re: External Database Authentication - connect to external database.

дэргэд 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