I forgot the password for mysql, so i was trying to change it using following steps -
1) Stop Mysql server
2)Start server in safe mode by using sudo /usr/local/mysql/bin/mysqld_safe --skip-grant-tables
3) Open mysql command line using sudo /usr/local/mysql/bin/mysql -u root
4) Update password using UPDATE mysql.user SET authentication_string=PASSWORD('NewPassword') WHERE User='root';
But on this step i am getting the following error message -
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '('NewPassword') WHERE User='root'' at line 1
Can someone tell how to resolve this error?