I have installed MySQL server 5 on redhat linux. I can\'t login as root so I can\'t change the root password.
mysql -u root -p
Enter password:
One option is to save UPDATE mysql.user SET Password=PASSWORD('newpass') WHERE User='root'; into a file and then manually start mysqld with --init-file=FILENAME. Once the server starts, it should reset your password, and then you should be able to log in. After this, you should shut down the server and start it normally.