0

I am a Linux user and I have updated my root password in mysql as :

update user set password=PASSWORD('xxxx') where user='root' and host='localhost';
flush privileges;
quit;

When I tried to login as :

mysql -u root -p xxxx

An Error occurred :- Access denied for 'ROOT'@'LOCALHOST' using password yes

What could be the problem? I know how to reset the mysql root password through terminal using root user. I just wanted to know why didn't this work.

Praveen Prasannan
  • 7,093
  • 10
  • 50
  • 70

1 Answers1

0

if you want to enter the password with the command line call, append it directly to the -p flag:

mysql -u root -pxxxx

or just leave it blank, then mysql will ask about it:

mysql -u root -p

Entering it directly to the command is not desireable, as it might show up in the process list and the shell history, so if you want it for personal use and not in a script, use the -p without a password

Kaffee
  • 1,563
  • 11
  • 21