在使用MySQL时,出现了这样的错误提示:
you must reset your password using alter
,让重设密码。
D:\xampps> mysql -uroot -prootmysql: [Warning] Using a password on the command line interface can be insecure.Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 14Server version: 5.7.9Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql>
mysql 5.7增加了两个字段password_last_changed、password_lifetime来完善安全策略。
fault_password_lifetime来延长使用期限或者ALTER USER 'root'@localhost' PASSWORD EXPIRE INTERVAL 90 DAYS;ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER;ALTER USER 'root'@'localhost' PASSWORD EXPIRE DEFAULT;
可以使用下面的语法进行权限设置:
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '518666' PASSWORD EXPIRE NEVER;Query OK, 0 rows affected (0.00 sec)
设置成功之后,可以成功使用 use mysql
命令了~
相关文章: