Is there an easy way to allow users to login just with a password and a username?

Ive seen Myrealm but im not sure on how you can set it so only specified passwords and loginnames work.

If anyone knows how to do a basic script that maybe stores the passwords and loginnames in MYSQL database let me know