Page 1 of 1

Mysql Problem ~> ERROR 1054 (42S22): Unknown column 'root'

Posted: Sat Sep 17, 2011 2:57 pm
by Alg0r1thm
Hi brothers ,
I was seeing bill wienman lynda mysql essential training tutorial I encounter that DAMN Error :
ERROR 1054 (42S22): Unknown column 'root' in 'where clause'
I input that code in command prompt :
UPDATE mysql.user SET Password = PASSWORD(`mypass`) WHERE User = `root`;
My time is left , I'm working fast to make myself prepared if anyone can help please CLICK REPLY FAST

God Bless You ... .

Re: Mysql Problem ~> ERROR 1054 (42S22): Unknown column 'roo

Posted: Sat Sep 17, 2011 5:29 pm
by jacek
backticks ` indicate a table or column name, you need to use quotes ' around your strings. So the fixed SQL would be
UPDATE `mysql`.`user` SET Password = PASSWORD(`mypass`) WHERE `user` = 'root';
but to set the password for a user you should really do
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('mypass');[/syntax
to limit the host the root user can be used from.