-
root先利用原密码登陆
mysql -u root -p
Enter password: *******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.26 MySQL Community Server - GPL
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
2.原修改方式syntx error
mysql> set password for root@localhost = password('xxxxx');
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 'password('xxxxxx')' at line 1
3.MySQL 8对应修改方式,修改的是当前登陆用户的password
mysql> set password = 'yyyyyy';
Query OK, 0 rows affected (0.07 sec)
mysql>
文章来源地址https://www.toymoban.com/news/detail-570155.html
文章来源:https://www.toymoban.com/news/detail-570155.html
到了这里,关于MySQL 8 修改root密码ERROR 1064 (42000): You have an error in your SQL syntax;的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!