Well, it sounds like while one attempts to login, one isn't really successfully logged on - that's why the re-direct back to the login page. Without knowing anything about moodle version, hosting situation/platform, etc. sounds like a sessions issue. By default, Moodle uses the DB to record session information upon logging on. It is the first thing done when one logs on.
Suggest adding the following line to config.php to see if it is a DB/sessions issue:
$CFG->dbsessions = '0';
That tells moodle to use files based recording of sessions. In moodledata/ one should see a 'sessions' folder created and upon the next attempt at login, a sessions file will appear for that user. If the sessions folder is not created by Moodle, what are permissions/ownerships of moodledata? Apache user/group (if running under apache on RedHat flavored server) *must* have enough rights to read/write to that directory.
Now this part ... "The person who helped install it said it might be related to editing a my.cnf file." ... did the person who helped install it look at any server logs to determine that? IF so, what did this person see? Did that person do any tweaks to DB server settings?
Does the DB user in the config.php file have access rights to the database for the Moodle? Is the DB password correct?
One could test: mysql -u [userfromconfig.phpfile] -p
Should be prompted for a password. If correct password, one will be at the mysql> prompt. Type: \q to quit the mysql client.
Did you also check apache error logs to see if there is a hint/clue there?
'spirit of sharing', Ken