If you haven't stopped and restarted the server, your root user will still be able to log in. The privileges table is not reread until the server is restarted, or until the root user invokes the FLUSH PRIVILEGES command from within mysql.
Failing that, mysql_install_db is the script that builds the privileges database on Unix systems, so running that would do the trick. saying that, Windows versions come with the privileges table pre-built, so mysql_install_db isn't used - even though it is included in the scripts directory of the installation.
If you're on Windows, you may try finding out if you can run mysql_install_db, somehow. However, if you're just using the thing to learn with and you don't mind losing whatever data is there, it's probably easier to just reinstall.
Let us know if you can still log in as root, and I'll talk you through rebuilding the user table in the mysql database, if you like.
Best of luck