That isn't how you set the password. That is how you login to mysql.
If you don't have a password set, you login using:
mysql -u root
and that will get you to the MySQL command line.
Instead of doing that just use the following to change the password.
mysqladmin -u root password NEWPASSWORD