External database enrolment
From MoodleDocs
You can use a external database (of nearly any kind) to control your enrolments. It is assumed your external database contains a field containing a course ID, and a field containing a user ID. These are compared against fields that you choose in the local course and user tables.
Supported data sources
access
ado
mssql
borland_ibase
csv
db2
fbsql
firebird
ibase
informix72
informix
mysql
mysqlt
oci805
oci8
oci8po
odbc
odbc_mssql
odbc_oracle
oracle
postgres64
postgres7
postgres
proxy
sqlanywhere
sybase
vfp