Set authentication_string in Mysql 8.0.19

8,455

Use ALTER_USER instead of SET authentication_string:

ALTER USER 'root'@'localhost' IDENTIFIED BY '1234';

Share:
8,455

Related videos on Youtube

Lokomotywa
Author by

Lokomotywa

Updated on September 18, 2022

Comments

  • Lokomotywa
    Lokomotywa almost 2 years

    Trying to reset root's password, I end up at this line:

    update user set authentication_string=password('1234') where user='root'
    

    which leads to a mean syntax error

    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 '('1234') where user='root''
    

    replacing password('1234') by '1234' works, so it looks like the 'password' function got missing. How do I hash my password then?

  • ChanganAuto
    ChanganAuto over 2 years
    This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. To get notified when this question gets new answers, you can follow this question. Once you have enough reputation, you can also add a bounty to draw more attention to this question. - From Review