Creating a Local Moodle Administrator

Creating a Local Moodle Administrator

by Gregory Furtman -
Number of replies: 3

The domain controller we were using for LDAP authentication went down so as an administrator I could not login to Moodle to point the LDAP at another domain controller.

Is there a way to create an admin account in Moodle that does not require LDAP authentication?

Average of ratings: -
In reply to Gregory Furtman

Re: Creating a Local Moodle Administrator

by Michael Rhodes -

Create a local account and assign it site admin role.  If your asking how to do that without access - I am not sure - possibly directly edit the database if you have access to it - I wouldn't try to edit the accounts and role assignments - I would look at the config table mdl_config and edit the enrol_ldap_host_url (I think that is the right one - but not sure) value to a working DC. BACKUP your database first.

On the initial install/setup of Moodle an admin account is created - not a good idea to remove this acount even after setting up other forms of authencation - I recommend putting a strong password on it and keeping it available for situations just like this.

Administration>Accounts>Users>Add New User

set authenication to 'manual accounts'

 

Average of ratings: Useful (1)
In reply to Gregory Furtman

Re: Creating a Local Moodle Administrator

by sandeep jain -
i have same problem that how i login in moodle as administrator when i import database from live site to my localhost ,there i can't login with any existing user .
In reply to sandeep jain

Re: Creating a Local Moodle Administrator

by Luis de Vasconcelos -

Try this on the localhost database (not the live site!):

First get the id of your admin user record on the mdl_user table:

SELECT id, username, auth
FROM mdl_user
WHERE (username = 'your_username')

That will show you the admin user record. Take the value that it shows in the id column and use it to change the authentication type for this admin user to manual:

UPDATE mdl_user
SET auth = 'manual'
WHERE id = 1
AND username = 'your_username';

I'm assuming that your admin id = 1. You need to change it to the correct value that you got from the first query above.

Now log in to the site and fix up your LDAP settings. You should have access to the site because Moodle won't try to authenticate your admin account against the LDAP server...