微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

数据库上手避坑之--修改sql的root密码

[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.

 

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐