-4

How do you set the root password in MySQL 5.6.16?

I have tries using:

UPDATE mysql.user SET Password=PASSWORD('newpass') WHERE User='root';

But it's showing me: Error 1064<42000>

Thejas B
  • 69
  • 1
  • 2
  • 9

3 Answers3

3

I think the command you are looking for is "SET PASSWORD".

For example it can be used like this:

SET PASSWORD FOR 'root'@'localhost' = PASSWORD( 'newpass' );
AeroX
  • 3,387
  • 2
  • 25
  • 39
Tezyn
  • 1,314
  • 1
  • 10
  • 24
0

I think the table name is user not user.root update user set password=PASSWORD("NEWPASSWORD") where User='root';

0

Try this:

update mysql.user set Password = PASSWORD('yourNewPass')
where User = 'root' and Host = 'localhost'
Hackerman
  • 12,139
  • 2
  • 34
  • 45