1

Sorry this is such a basic question, but I'm struggling to get any of the solutions I've found online working. Basically I've managed to lose my MySQL password for my local machine and now I'm completely locked out

I've tried resetting it using this command:

mysqladmin password example_new_password

But that gives me an error saying "mysqladmin: connect to server at 'localhost' failed. Error: 'Access denied for user 'root'@'localhost' (using password: NO)'

And I've also tried following these instructions (https://goo.gl/lvV1jo), but when there's no .pid file or anything named 'mysqld' in /var/lib/mysql so I couldn't do much from there

Can anyone help point me in the right direction? I'm a little lost at the moment

Thorium
  • 191
  • 1
  • 14

1 Answers1

1

You can try:

sudo dpkg-reconfigure mysql-server-N.N

Where N.N is your MySQL version.

If that doesn't work, have a look here: https://help.ubuntu.com/community/MysqlPasswordReset

Ben Fried
  • 2,168
  • 1
  • 14
  • 13
  • I did "mysqladmin --version" which gave me "Ver 8.42 Distrib 5.5.43", then I entered "dkpg-reconfigure mysql-server-8.43" but I got an error saying "mysql-server-8.42 is not installed"? I got up to "start the mysql client process using this command" on the ubuntu page, but entering "mysql -u root" spits out this error > Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' – Thorium Jul 21 '15 at 01:27
  • Your mysql version is 5.5.43 not 8.42...There is no 8.43...the latest version of mysql is only 5.7.XX...also from the terminal do a `ps aux | grep mysql` to see if mysql is even running...+1 @Ben Fried – BK435 Jul 21 '15 at 01:29
  • Sorry, I just assumed it was version 8.42 since it said "Ver 8.42". I'm getting the exact same error when I change it to 5.5.43 though, and MySQL if definitely running. – Thorium Jul 21 '15 at 03:20