Thanks again.
Remember to then login as admin and change your admin password to something a little more original.
I get the basic idea but am not sure about the specifics. Do you mean access the mysql database on the webhost and change the password there? Or does it need to be changed in one of the text files? That's where I've been looking, in vain, for a solution.
I really appreciate your help.
Steven
Yes, you'll have to access your db and make the changes. There is a strong caveat involved in under-taking this sort of activity but I will not include it unless it's requested.
All the best,
John
Thanks again for your prompt assistance John.
Best,
Steven
Hi John
I might need that caveat! I've not been able to use my admin account/username either - I too forgot them as part of the set up procedure.
I've tried accessing the db (mysql via phpadmin) and making changes to the admin password but to no avail.
I'm not able to use the "forgot password" button on the screen because I've got everything on my PC (it's not a server) and everything else has been working fine...except my admin login.
Cheers
Mark
Have sorted it out now. I went in to mySQL, copied and pasted another known password in to the admin password table entry.
Mark
Now everything is up and running. Thanks again for your help.
Best,
Steven
I have forgotten my password too. I have too many Moodle installations.
When I click on "forgotten my password" link the page is dead (the link broken). This may be because I am using IMAP authentication for all but the administrators passwords and my universities IMAP does not offer the service of sending out forgotten passwords. So perhaps the button takes me to a non existant would-be-IMAP-supported page. It would be nice if the administrators (whose authentication is NOT IMAP) could have their passwords sent to them. (As mentioned before it is nice to have too methods of authentication since I can set up users so long as they administrators.)
The Moodle is not on a local server so I cannot access the database using command line mysql commands. I do not have mysql-admin installed so I cannot get at the database that way.
I can only log in as a student.
Oops.
Tim
I uploaded mysql admin into the moodle admin directory but, of course, when I try and go there I get "you have to be admin to access this page." So I guess that everyone else that lost their administrator password must have access to the command line or other MYSQL access tools on their computer.
Perhaps I can figure out a way to h4ck mysql admin so that I can put it somewhere outside of the moodle directory. If it were that easy though, there would be break-ins to Moodles everywhere.
That will work, that is what happens effectivly when you use the full version of the mySQL admin client, and in theory it need not even be on the same machine. However the mySQL security is then the limiting factor, the username/password combo for the moodle database and the IP addresses that are allowed access will be your next stumbling block (or not of course if you know them which I guess is what you are hoping )
Good luck,
Kevin
Hi
i installed moodle in my website but i am stuck in login screen as i cannot log in. i enter the username and the password provided for me but when i try to login nothing happens still i remain in login page telling me to login.
my moodle software was instaled on my wesite from Lycos OneClickSite software, also the tables and the php was configured from them.
i want ot modify my site but i can not as i can not login. any help would be apreciated.
thank you very much
Thanks Kevin Lawry,
Fortunately since I still have ftp access I know my mysql database passwords/username.
So I did as you say and got back into my Moodle! Thank you thank you!
This is how to get into your moodle if you lose or forget your password but still have ftp access to your server.
1) Copy the following information in your config.php in your moodle director.
//$CFG->dbhost = 'very_private'; // eg localhost or db.isp.com
//$CFG->dbname = 'very_private'; // database name, eg moodle
//$CFG->dbuser = 'very_private'; // your database username
//$CFG->dbpass = 'very_private'; // your database password
2) Uploaded mysql admin in the base directory of my server (away from Moodle's login control) mysql admin is available here
http://prdownloads.sourceforge.net/moodle/moodle-1.2-mysql-admin.zip
3) replaced the config.inc.php with the config.inc.php from
http://cvs.sourceforge.net/viewcvs.py/phpmyadmin/phpMyAdmin/config.inc.php
(I could have downloaded a complete phpmyadmin from http://phpmyadmin.net
, but the only difference seems to be the config file which, in the moodle release references the database information in moodle's config.php, of course, and I had already downloaded a copy of the moodle version of phpmyadmin.)
4) Type in the host, user, database, password as per the instructions at phpmyadmin, using the information from the moodle config.php. This is near the top of config.inc.php. Change the areas marked very_private.
$cfg['Servers'][$i]['host'] = 'very_private'; // MySQL hostname or IP address
$cfg['Servers'][$i]['port'] = ''; // MySQL port - leave blank for default port
$cfg['Servers'][$i]['socket'] = ''; // Path to the socket - leave blank for default socket
$cfg['Servers'][$i]['connect_type'] = 'tcp'; // How to connect to MySQL server ('tcp' or 'socket')
$cfg['Servers'][$i]['extension'] = 'mysql'; // The php MySQL extension to use ('mysql' or 'mysqli')
$cfg['Servers'][$i]['compress'] = FALSE; // Use compressed protocol for the MySQL connection
// (requires PHP >= 4.3.0)
$cfg['Servers'][$i]['controluser'] = ''; // MySQL control user settings
// (this user must have read-only
$cfg['Servers'][$i]['controlpass'] = ''; // access to the "mysql/user"
// and "mysql/db" tables).
// The controluser is also
// used for all relational
// features (pmadb)
$cfg['Servers'][$i]['auth_type'] = 'config'; // Authentication method (config, http or cookie based)?
$cfg['Servers'][$i]['user'] = 'very_private'; // MySQL user
$cfg['Servers'][$i]['password'] = 'very_private'; // MySQL password (only needed
// with 'config' auth_type)
$cfg['Servers'][$i]['only_db'] = very_private'; // If set to a db-name, only
// this db is displayed in left frame
5) Go to
http://yourdomain/mysql/
(the instructions at phpmyadmin.net say go to http://yourdomain/mysql/index.php but that did not work for me. Perhaps this is something else that has changed in the Moodle-ized version of phpmyadmin )
6) I go to the users table entry (not to the users_admin screen) and there you will see the users and their encoded passwords.
7) Copy the guest password to the admin password. I am pretty sure that the guest password is "guest". (Fortunately I had created another test student password that I remember so I copied that instead.)
8) Log into your moodle with the guest password.
9) Change your password.
10) Delete myphpadmin or at least password protect its folder.
Thanks again,
Tim
Takemoto
Thanks Tim of the past, I had forgotten the above so it is a good thing you wrote it down.
I think that the above should go in a FAQ somewhere, if I say so myself.
Tim
http://moodle.org/mod/forum/discuss.php?d=34419
the first 5 of the stepts above are unecessary. If you install navicat you can set up a connection to your moodle database rather like setting up a FTP connection with address, username and password. Then you can copy and pasted the guest user password to the admin user password as if you were using Excel. Navicat looks a lot like Excel.
Tim
Tim (and anyone else who comes across this posting!) -
I need help.
Due to some strange glitch (I assume it's a glitch in the host's mailserver even though they deny it) I cannot retrieve my admin password: my attempts to retrieve it using the "Send it to me via e-mail" button yield a failure e-mail:
A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:
lev.abramov @ gmail.com
unrouteable mail domain "gmail.com"
The irony of the matter is that this error message is delivered to the very address that is reported undeliverable!
Never mind, we'll sort it out.
What I need now is a way to recover my admin password. I already understand I have to edit a DB table. I have access to the DB via PHPmyAdmin in the cPanel provided by the host. But I have no idea how to do that - I've never touched any DB of mine.
Can you pleeeeeeeeeeeze hold my hand while I'm doing it? Both in terms of WHAT to do and HOW to do it?
TIA!
Please follow the instructions for changing the admin password in MoodleDocs Administration FAQ. If you require further explanation, please say so.

I apologize if there is an answer to this previously posted.
I need help Please. I cannot locate my admin password.
I have sent the email request and never received an email.
I have also tries accessing the phpMyAdmin database. I tried to change the password in the mdl_user table and it still does not work. I've copied other encrypted passwords that work and it still does not work.
I think i disable the feature to log on as a guest but i tried to copy that info in the mdl_user table as well.
Please help me! Thank you
If you copied md5 hashed passwords from accounts that are working (and you are completely sure of this), then you should be able to login... unless the admin account is:
* marked as deleted, in which case you need to set the deleted field to 0 (zero) and the username field to admin.
* using an authentication method other than manual, in which case you need to set the auth field to manual.
hello thank you for responding.
i have tried coping the hashed passwords from every account that works and it does not work and nothing works. I checked to see if the admin account had been deleted and it also does not work. I tried to passchange.php and the resetuser.php.
Any other suggestions?
Is there anything else that I may try?
Do you get any error messages? Can you enable the debugging system?
http://docs.moodle.org/22/en/Debugging
Take note that you can enable it by modifying config.php.
I would also try to take a look at the server error log.
I am not sure what is going on, but I tried degugging as suggested and nothing!
I don't know what else to do but uninstall Moodle and start all over.
I appreciate you!!
i have another account where I am the student or teacher. is there anyway for me to make that user account the admin?
Hi,
Yes, but what Moodle version are you using?
1.9.17 on GoDaddy
Hi,
For M 2.2
** Get your other account user's id.
Go to Administration > Users > Accounts > Browse list of users
Select your user account; the URL will then show the user's id:
yoursite.com/moodle/user/profile.php?id=74
** Open your phpMyAdmin, select your mdl_config table and run the following SQL command:
SELECT *
FROM `mdl_config`
WHERE `name` = "siteadmins";
Take note of the value(s) at the value field, for example: 2,6
* Now run the following SQL command (use your own values at the SET `value` line):
UPDATE `mdl_config`
SET `value` = '2,6,74'
WHERE `name` = "siteadmins";
For M 1.9
* Get your other account user's id.
Go to Administration > Users > Accounts > Browse list of users
Select your user account; the URL will then show the user's id:
yoursite.com/moodle/user/view.php?id=74&course=1
* Now run the following SQL command (use your own value for the userid column):
INSERT INTO `mdl_role_assignments` ( `roleid`, `contextid`, `userid`, `hidden`,
`timestart`, `timeend`, `timemodified`, `modifierid`, `enrol`, `sortorder` )
VALUES ( 1, 1, 74, 0, 1334293200, 0, 1334351421, 2, 'manual', 0 );
Thank you, I will give that a try