ERROR 1045 (28000): Access denied for user ‘root’@'localhost’

After installing Mysql, I ran into following error:

ERROR 1045 (28000): Access denied for user ‘root’@'localhost’ (using password: YES)

This error can be bypassed by issuing following commands:

1. service mysql stop
2. mysqld_safe –skip-grant-tables &
3. log in with : mysql -u root mysql
4. In MySQL command line prompt issue the following command:
UPDATE user SET password=PASSWORD(”abcd”) WHERE user=”root”;
FLUSH PRIVILEGES;
exit
5. Restart mysql (service mysqld restart)

Leave a Reply

about my life, my work, my interests, technical stuff, ….