login/password

Re: login/password

by Timothy Takemoto -
Number of replies: 6

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

In reply to Timothy Takemoto

Re: login/password

by Timothy 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

In reply to Timothy Takemoto

Re: login/password

by Timothy Takemoto -
Now that i have seen the light of Navicat
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
In reply to Timothy Takemoto

Re: login/password

by Lev Abramov -

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!

In reply to Lev Abramov

Re: login/password

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Lev,

Please follow the instructions for changing the admin password in MoodleDocs Administration FAQ. If you require further explanation, please say so. smile
In reply to Helen Foster

Re: login/password

by Jon Roland -
I installed Moodle at my site http://www.nomocracy.org/index.php? using the Fantastico one-click install and created a username of jonroland, but now I don't seem to have admin access to create courses,. configure the site, etc. Does anyone know how that one-click install sets up Moodle and what one does next?
In reply to Jon Roland

Re: login/password

by Nugroho Widi -
I install Moodle 1.9.7+ in a webserver. Afrer succesful install, i cannot login using my id and password. I think it is a serious problem. I tried everything including check mysql and copy paste password etc, but no avail. I cannot login at all. My friend who is a web programmer also wonder what happened.