前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >破解Mariadb5.5密码

破解Mariadb5.5密码

作者头像
院长技术
发布2020-09-02 08:52:05
8260
发布2020-09-02 08:52:05
举报
文章被收录于专栏:院长运维开发院长运维开发

破解Mariadb数据库root密码

先停止Mariadb服务:

代码语言:javascript
复制
systemctl stop mariadb

找并运行 mysqld_safe 程序绕开 MariaDB5.5 数据库密码验证

代码语言:javascript
复制
[root@localhost ~]# find / -name mysqld_safe
/usr/bin/mysqld_safe
[root@localhost ~]# /usr/bin/mysqld_safe --skip-grant-tables &

我们再打开一个ssh终端,直接使用 mysql 命令登录 MariaDB5.5 数据库并修改 root 登录密码

代码语言:javascript
复制
[root@localhost ~]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 1
Server version: 5.5.65-MariaDB MariaDB Server

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)]> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [mysql]> UPDATE user SET password=password("填写新的数据库密码") WHERE user='root';
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3  Changed: 3  Warnings: 0

MariaDB [mysql]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

MariaDB [mysql]> exit
Bye

启动Mariadb服务:

代码语言:javascript
复制
systemctl start mariadb

如果启动失败,就直接重启服务器试试即可。

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
云数据库 SQL Server
腾讯云数据库 SQL Server (TencentDB for SQL Server)是业界最常用的商用数据库之一,对基于 Windows 架构的应用程序具有完美的支持。TencentDB for SQL Server 拥有微软正版授权,可持续为用户提供最新的功能,避免未授权使用软件的风险。具有即开即用、稳定可靠、安全运行、弹性扩缩等特点。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档