You can use phpMyAdmin to reset the password on your admin account - use the Browse tool to find the record, click the edit icon, then change the password field. In the dropdown menu to the left, choose "MD5", then submit the form.
Once you've regained access to your admin account, shut down the board and upgrade to 6.5 immediately.
Chances are that more than one account was compromised, so you should have all of your administrators and moderators change their passwords.