[developRos nication]# mysqladmin -u root -p flush-privileges password      //使用命令修改系统
Enter password: 
[developRos nication]# mysql -u root -p                              //使用老密码登陆
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 10.5.8-MariaDB Arch Linux

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> \q                                          //用\q退出
Bye
[developRos nication]# mysql -u root -p                               //使用老密码登陆
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 5
Server version: 10.5.8-MariaDB Arch Linux

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> exit                                        //用exit退出或者执行mysqladmin -u root -p flush-privileges刷新也可以
Bye
[developRos nication]# exit
exit
 nication  ~  mysql -u root -p                                  //使用新密码登陆
Enter password: 
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
 nication  ~  mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 7
Server version: 10.5.8-MariaDB Arch Linux

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

 

相关文章:

  • 2021-08-30
  • 2021-11-27
  • 2022-12-23
  • 2022-12-23
  • 2021-05-17
  • 2022-02-12
  • 2021-10-27
猜你喜欢
  • 2021-08-16
  • 2021-06-02
  • 2022-01-24
  • 2021-12-06
  • 2022-02-14
  • 2021-12-04
  • 2021-12-18
相关资源
相似解决方案