Mysql – thesql user table

MySQL

I'm using MySQL.

I run an update statement against the table user to change password of the root user. Here is how the first row looks when I query select * from user:

| localhost          | root             | sam            

My first question is why password isn't encrypted.

Secondly, when I'm trying to login

mysql -u root -p 

using the same password it responds

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

Best Answer

Don't play around with system tables.
If you want to change the password use SET PASSWORD