+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 19
Windows Thread, Quite a big moodle problem in Technical; We are running moodle 1.8.1 and have lost our administrators table in MYSQL, which is tied into AD. Hence we ...
  1. #1
    timbo343's Avatar
    Join Date
    Dec 2005
    Location
    Leeds/York area, North Yorkshire
    Posts
    3,051
    Thank Post
    308
    Thanked 293 Times in 203 Posts
    Rep Power
    120

    Quite a big moodle problem

    We are running moodle 1.8.1 and have lost our administrators table in MYSQL, which is tied into AD. Hence we have lost the original loging that was created to build moodle before it was tied into AD. The guy configuring and that works on the moodle server is our network manager who works part time. What im asking is, is there anyway we can rebuild a list of administrators or will it have to be start from scratch job, as the main IT teachers cannot upload any courses for the kids and cannot track their grades.

    Thanks

    Tim

  2. #2

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,412
    Thank Post
    642
    Thanked 963 Times in 663 Posts
    Blog Entries
    2
    Rep Power
    326

    Re: Quite a big moodle problem

    Just restore it from the last backup?

  3. #3
    timbo343's Avatar
    Join Date
    Dec 2005
    Location
    Leeds/York area, North Yorkshire
    Posts
    3,051
    Thank Post
    308
    Thanked 293 Times in 203 Posts
    Rep Power
    120

    Re: Quite a big moodle problem

    ahhh, yeah never thought of that... derr.. will see when he took a backup... trouble is he doesnt seem to be all there and is a bit slow at doing things

    Cheers

  4. #4
    timbo343's Avatar
    Join Date
    Dec 2005
    Location
    Leeds/York area, North Yorkshire
    Posts
    3,051
    Thank Post
    308
    Thanked 293 Times in 203 Posts
    Rep Power
    120

    Re: Quite a big moodle problem

    Right, we dont know if he has been taking backups, i guess he hasnt. I think we are pretty screwed unless anyone has any ideas.

  5. #5

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,412
    Thank Post
    642
    Thanked 963 Times in 663 Posts
    Blog Entries
    2
    Rep Power
    326

    Re: Quite a big moodle problem

    Has anyone had similar problems on the Moodle forum at all?

  6. #6
    timbo343's Avatar
    Join Date
    Dec 2005
    Location
    Leeds/York area, North Yorkshire
    Posts
    3,051
    Thank Post
    308
    Thanked 293 Times in 203 Posts
    Rep Power
    120

    Re: Quite a big moodle problem

    im looking at something on the moodle site http://moodle.org/mod/forum/discuss.php?d=54165 but i dont know how mysql works, so im a bit stuck on how to get into the databases.

  7. #7
    timbo343's Avatar
    Join Date
    Dec 2005
    Location
    Leeds/York area, North Yorkshire
    Posts
    3,051
    Thank Post
    308
    Thanked 293 Times in 203 Posts
    Rep Power
    120

    Re: Quite a big moodle problem

    right im into the mysql server. how on earth do i find the tables?

  8. #8

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,807
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224

    Re: Quite a big moodle problem

    The database doesn't work like that. There is no 'administrstors' table. There is a 'mdl_user' table that holds all the basic info for all your users. Each user has an 'id' in this table. This is cross referenced with the 'mdl_role_assignment' table. Which sets the role assignments for users, including the admin role. Therefore you must first search the mdl_user table for a replacement 'admin' user and find the id. Once this has been done then you can add a new record to the 'mdl_role_assignment' table and manually give this user admin rights.

    For example, if I wanted to give the user with id 20 administration rights.

    Code:
    INSERT INTO `mdl_role_assignments` ( `id` , `roleid` , `contextid` , `userid` , `hidden` , `timestart` , `timeend` , `timemodified` , `modifierid` , `enrol` , `sortorder` )
    VALUES (
    LAST_INSERT_ID( ) , '1', '1', '20', '0', '0', '0', UNIX_TIMESTAMP( NOW () ) , '0', 'manual', '0'
    );

  9. #9
    timbo343's Avatar
    Join Date
    Dec 2005
    Location
    Leeds/York area, North Yorkshire
    Posts
    3,051
    Thank Post
    308
    Thanked 293 Times in 203 Posts
    Rep Power
    120

    Re: Quite a big moodle problem

    okay lol. quick question, is there a way to view what is inside the tables?

  10. #10

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,412
    Thank Post
    642
    Thanked 963 Times in 663 Posts
    Blog Entries
    2
    Rep Power
    326

    Re: Quite a big moodle problem

    Code:
    SELECT * FROM tablename;
    Will show all columns. Which will be a lot of data to look through. You will best off doing a few, such as:

    Code:
    SELECT id, roleid, userid FROM tablename
    Replacing tablename with the name of the table you want to look at.

  11. #11
    timbo343's Avatar
    Join Date
    Dec 2005
    Location
    Leeds/York area, North Yorkshire
    Posts
    3,051
    Thank Post
    308
    Thanked 293 Times in 203 Posts
    Rep Power
    120

    Re: Quite a big moodle problem

    webman, just to let you know, i did a search:

    SELECT id, roleid, userid FROM mdl_user;

    and i got

    ERROR 1054 (42S22): Unknown column 'roleid' in 'field list'

    Does this mean that roleid does not exist

  12. #12

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,412
    Thank Post
    642
    Thanked 963 Times in 663 Posts
    Blog Entries
    2
    Rep Power
    326

    Re: Quite a big moodle problem

    It just means that column doesn't exist in the mdl_user table. I was just plucking example fields from the query in Geoff's post, which operates on the mdl_role_assignments table.

    You can find out the columns in a table like so:

    Code:
    SHOW COLUMNS FROM tablename

  13. #13
    timbo343's Avatar
    Join Date
    Dec 2005
    Location
    Leeds/York area, North Yorkshire
    Posts
    3,051
    Thank Post
    308
    Thanked 293 Times in 203 Posts
    Rep Power
    120

    Re: Quite a big moodle problem

    ok, another question.

    Is it possible to find the user with the id of say 145 and show all the details?

  14. #14

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,807
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224

    Re: Quite a big moodle problem

    Code:
    SELECT * FROM 'mdl_user' WHERE 'id' = 145;
    Just be aware there are numerous other mdl_user_* tables with additional user info in them. However I don't believe they are relevant to what you are attempting to do.

  15. #15
    timbo343's Avatar
    Join Date
    Dec 2005
    Location
    Leeds/York area, North Yorkshire
    Posts
    3,051
    Thank Post
    308
    Thanked 293 Times in 203 Posts
    Rep Power
    120

    Re: Quite a big moodle problem

    what im trying to do is to look at a specific user to see what access they have, and change it if it aint right, as i have found the mdl_role table with all the roles

SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. dunno if this is an exchange or moodle problem
    By timbo343 in forum Windows
    Replies: 1
    Last Post: 23rd January 2007, 02:56 PM
  2. Moodle - Problem
    By wesleyw in forum Virtual Learning Platforms
    Replies: 8
    Last Post: 9th November 2006, 09:07 AM
  3. Moodle Problem.
    By Quackers in forum Virtual Learning Platforms
    Replies: 3
    Last Post: 18th September 2006, 03:42 PM
  4. Moodle Problem
    By jamieallonby in forum Virtual Learning Platforms
    Replies: 2
    Last Post: 16th May 2006, 06:54 AM
  5. Moodle or not to Moodle
    By alan-d in forum Web Development
    Replies: 5
    Last Post: 20th January 2006, 11:56 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •