You Can try the following methods:
- First, try using the link "Forgotten your username or password?" to send your details via email.
- If you can access the database using an administration tool, you can modify a password there. Password for all users, including admin, are stored encrypted in the table mdl_user (where mdl is the prefix used for the tables). There you will find the list of all users and their details. Copy the value in the password field of the guest user and paste it into the password field of the admin user. Then, Log in to the Moodle site by using the password-guest and change the password.