mysql5.7.9
After that, there is no password
function, so, using the traditional password()
function to change the root password, you will be prompted sql error
UPDATE user SET authentication_string = password('123456') WHERE User='root'; 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 '('123456') WHERE User='root'' at line 1
The correct way is to set a password:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';
A prompt modified successfully, quit mysql landing again the need to enter a password just set.
For details, please refer to the article: