Archive for July, 2013

Sometimes while installing mysql or upgrading mysql can get the following error:

[root@xxxx ~]# mysql
ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: NO)

To resolve this issue, please follow the snippet pasted below:

[root@xxxx ~]# service mysql stop
Shutting down MySQL.. SUCCESS!

[root@xxxx ~]# cd /usr/bin/

[root@xxxx bin]# mysqld_safe --skip-grant-tables &

130722 21:00:30 mysqld_safe Logging to ‘/var/lib/mysql/’.
130722 21:00:30 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

  • Open another terminal and open a mysql session to execute this:

[root@xxxx~]# mysql

mysql> use mysql;

mysql> UPDATE user SET password=PASSWORD('NEW_PASSWORD_HERE') WHERE user = 'root';


  • Now kill the mysqld_safe process and restart mysqld normally:

[root@xxxx~]# service mysql start


Issue Fixed! 🙂