1

I am just starting to learn MySQL, im running 5.7.20 on Mac os 10.12 when i tried to use the following command in Terminal to reset password

mysql> UPDATE mysql.user SET authentication_string = PASSWORD('password')

i am keep getting

-bash: syntax error near unexpected token `('

Can anyone assist me with that error message? i have tried many different website no one seems to have an answer to that.

Last login: Tue May 28 02:07:04 on ttys001
192-168-1-5:~ Betty$ mysql> UPDATE mysql.user SET authentication_string = PASSWORD('password')
-bash: syntax error near unexpected token `('

2 Answers 2

1

When you see mysql> something, it doesn't mean to type mysql> something at the Bash prompt. It means to type something at the MySQL prompt. Run the command properly from inside MySQL and it will work.

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

Comments

0

If you want to run mysql command from within bash you may want to use -e option as in:

mysql -uusername -ppassword -e "UPDATE mysql.user SET authentication_string = PASSWORD('password')"

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.