数据库上手避坑之--修改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.
复制代码

 

posted @   叕叒双又  阅读(255)  评论(0编辑  收藏  举报
编辑推荐:
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具
历史上的今天:
2017-11-24 《Linux命令行与shell脚本编程大全 第3版》Shell脚本编程基础---27
2017-11-24 《Linux命令行与shell脚本编程大全 第3版》Shell脚本编程基础---26
2017-11-24 《Linux命令行与shell脚本编程大全 第3版》Shell脚本编程基础---25
2017-11-24 《Linux命令行与shell脚本编程大全 第3版》Shell脚本编程基础---24
2017-11-24 《Linux命令行与shell脚本编程大全 第3版》Shell脚本编程基础---23
2017-11-24 《Linux命令行与shell脚本编程大全 第3版》Shell脚本编程基础---22
2017-11-24 《Linux命令行与shell脚本编程大全 第3版》Shell脚本编程基础---21
点击右上角即可分享
微信分享提示