WeBWorK Main Forum

Resetting admin password using Mysql

Re: Resetting admin password using Mysql

by Thomas Hagedorn -
Number of replies: 0

Thank you Gavin! I was able to use your post to repair the database. In case anyone else has this problem, here's what I did:

I used the following commands (where "..." indicates the values copied for admin from another course as Gavin indicated in his post):

INSERT INTO admin_key SET user_id="admin", key_not_a_keyword="...";
INSERT INTO admin_password SET user_id="admin", password="...";
INSERT INTO admin_permission SET user_id="admin", permission="10";
INSERT INTO admin_user SET user_id="admin", first_name="System", last_name="Administrator", email_address="webwork@yourschool.edu", student_id="admin", status="C",section="NULL", recitation="NULL",comment="NULL";

(By the way, the UPDATE command didn't work for me as "admin" wasn't even listed under admin_password, so I had to recreate the row before changing the password.)

Now I didn't do all this correctly the first time, so once the table admin_password had the row "admin" set up, I ran the command

newpassword admin admin your_password_here

in /webwork2/bin to change the admin password from the command line. If one runs the four commands above correctly, this last step might not be necessary.

So far, everything seems to be working fine. I've created/deleted a course using the Course Administrator page, so the admin account seems to be set up fine.

-Tom