Installation > missing Admin user step

Re: Installation > missing Admin user step

by Shane Elliott -
Number of replies: 0
Picture of Core developers Picture of Plugin developers
Hi Scott

I did see your other post but haven't had a chance to reply to it.

The easiest way to access the 'user_admins' table is to use phpMyAdmin. There is a customised version for moodle available via CVS or at:
http://download.moodle.org/download.php/sourceforge/moodle-mysql-admin-2.6.2.zip
Just unzip it into your moodle admin directory.

Otherwise you could just write a php script to do it for you. Something like:
<?php
require('config.php');
require_login();
add_admin($USER->id);
redirect($CFG->wwwroot);
?>
1. Put the above lines in a script (eg called addadmin.php)
2. Place it in your root moodle directory (the one with config.php in it)
3. Log in with the user you want to become an admin
4. Call the script eg http://your.moodle.site/addadmin.php
5. You should now be an admin
6. Delete the file - it is a BIG security risk!

HTH