mysql UPDATE mysqluser SET authentication_string=PASSWORDpassword WHERE User=root;ERROR 1064 42000 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
The syntax error in your query is caused by using the PASSWORD function, which is no longer supported in MySQL 8.0 and above. Instead, you should use the ALTER USER statement to update the password. Here's the corrected query:
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'password';
This query will update the password for the 'root' user to 'password'. Make sure to replace 'password' with your desired password.
原文地址: https://www.cveoy.top/t/topic/iMyd 著作权归作者所有。请勿转载和采集!