-1

I am unable to remember the password for mysql database.

Using the ALTER USER statement does not work to update the password.

does anyone know how to do this?

I am entering:

ALTER USER 'root'@'localhost' IDENTIFIED BY 'passwordhere';

the error I am receiving is

"You must reset your password using the ALTER USER 
statement before executing this statement." 
473183469
  • 1,350
  • 1
  • 12
  • 23
Karen
  • 1
  • 1
  • 2
    Possible duplicate of [How to reset or recover admin account password for MySQL?](http://serverfault.com/questions/4309/how-to-reset-or-recover-admin-account-password-for-mysql) – Slipeer Jan 24 '17 at 14:56
  • Hey Karen, can you please let us know some other details, OS, MySQL version, commands you have tried and the errors you are getting. – Anthony Fornito Jan 24 '17 at 15:13
  • I am currently going through the working solution in that post now Slipeer but I'm having problems with that too @AnthonyFornito I am entering ALTER USER 'root'@'localhost' IDENTIFIED BY 'passwordhere' ... the error I am receiving is "You must reset your password using the ALTER USER statement before executing this statement. – Karen Jan 24 '17 at 15:21
  • @Karen can you edit you question to include details in the question, it hard to tell what is a comment and what is a command in the comments. – Anthony Fornito Jan 24 '17 at 15:24
  • 2
    Possible duplicate of [I changed mysql root password and I cant access It. password contained some chars](http://serverfault.com/questions/606072/i-changed-mysql-root-password-and-i-cant-access-it-password-contained-some-char) – user9517 Jan 24 '17 at 17:18

1 Answers1

0

As described in mysql reference manual, the syntax for password change is:

SET PASSWORD = PASSWORD('new_password');

Also - similar question was answered here: https://stackoverflow.com/questions/33467337/reset-mysql-root-password-using-alter-user-statement-after-install-on-mac

fhunter
  • 1
  • 1
  • This still throws up the same error... i'm trying the post that slipeer posted but i'm having trouble with that too – Karen Jan 24 '17 at 15:58