Archive

Posts Tagged ‘mysqld’

MySQL: Error 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: NO) [REVISITED]

November 7, 2015 Leave a comment

Have you ever read my 2011 post about this error? Check this before:

https://myotragusbalearicus.wordpress.com/2011/11/21/mysql-error-1045-28000-access-denied-for-user-rootlocalhost-using-password-no/

After that, if you’re still getting the same error, simply try this:

$ mysql -u root -p

You’ll be prompted for root password. Type it and you’re connected to the database.

Please, share your comments below.

Categories: MySQL Tags: , , ,

MySQL: Error 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: NO)

November 21, 2011 36 comments

I’ve upgraded MySQL server version to 5.1.54-1ubuntu4 and when I try to connect to the database I’m getting this error:


$ mysql -u root

Error 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

Maybe updating the package the updater overwrote the root password.

To restore it:

  • Stop mysqld deamons.
$ sudo service mysql stop
  • Go  to  mysql/bin directory
$ cd /usr/bin
  • Start a mysql deamon with this option:
$ sudo mysqld_safe --skip-grant-tables
  • Open another terminal and open a mysql session to execute this:
$ mysql
mysql> use mysql;
mysql> UPDATE user SET password=PASSWORD('YOUR_NEW_PASSWORD_HERE') WHERE user = 'root';
mysql> exit;
  • Now kill the mysqld_safe process and restart mysqld normally:
$ sudo service mysql start
Categories: MySQL, ubuntu Tags: , , , ,