1

I am able to change mysql user password using set password method and alter user statement. But, failed with update user command.

mysql> UPDATE USER SET PASSWORD=PASSWORD('George$987') where USER = 'george' and host='localhost'; 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 '('George$987') where USER = 'george' and host='localhost'' at line 1

What is the error in my below statement:

UPDATE USER SET PASSWORD=PASSWORD('George$987') where USER = 'george' and host='localhost';

1 Answer 1

3

I'm guessing you are using MySQL 8.0. You must use SET PASSWORD in MySQL 8.0.

https://dev.mysql.com/doc/refman/8.0/en/encryption-functions.html#function_password says:

  • PASSWORD(str)

    This function was removed in MySQL 8.0.11.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.