Well, for one thing, you have not selected any particular database, and that could be the problem. Aside from that, you can use:
mysql_query($query) OR die(mysql_error());
to help you debug, besides doing things like checking the username and password by printing them out.