mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-03-27 02:30:10 +08:00
PUB:20170308 How to Reset MySQL or MariaDB Root Password in Linux.md
@geekpi @jasminepeng
This commit is contained in:
parent
c0f1543ab8
commit
452068f444
@ -1,9 +1,9 @@
|
|||||||
如何在 Linux 中重置 MySQL 或者 MariaDB 的 root 密码
|
如何在 Linux 中重置 MySQL 或者 MariaDB 的 root 密码
|
||||||
============================================================
|
============================================================
|
||||||
|
|
||||||
如果你是第一次设置 MySQL 或 MariaDB 数据库,你可以直接运行 mysql_secure_installation 来实现基本的安全设置。
|
如果你是第一次设置 MySQL 或 MariaDB 数据库,你可以直接运行 `mysql_secure_installation` 来实现基本的安全设置。
|
||||||
|
|
||||||
其中一项是设置数据库 root 帐户的密码 - 你必须保持私密,并仅在绝对需要时使用。如果你忘记了密码或需要重置密码(例如,当数据库管理员更改角色或被裁员!),这篇文章会派上用场。我们将解释如何在 Linux 中重置或恢复 MySQL 或 MariaDB 的 root 密码。
|
其中一项是设置数据库 root 帐户的密码 - 你必须保持私密,并仅在绝对需要时使用。如果你忘记了密码或需要重置密码(例如,当数据库管理员换人或被裁员!),这篇文章会派上用场。我们将解释如何在 Linux 中重置或恢复 MySQL 或 MariaDB 的 root 密码。
|
||||||
|
|
||||||
**建议阅读:** [更改 MySQL 或 MariaDB 的 root 密码] [1]。
|
**建议阅读:** [更改 MySQL 或 MariaDB 的 root 密码] [1]。
|
||||||
|
|
||||||
@ -20,7 +20,7 @@
|
|||||||
# /etc/init.d/mysqld stop
|
# /etc/init.d/mysqld stop
|
||||||
```
|
```
|
||||||
|
|
||||||
接下来,用 `--skip-grant-tables` 启动服务:
|
接下来,用 `--skip-grant-tables` 选项启动服务:
|
||||||
|
|
||||||
```
|
```
|
||||||
------------- SystemD -------------
|
------------- SystemD -------------
|
||||||
@ -30,6 +30,7 @@
|
|||||||
------------- SysVinit -------------
|
------------- SysVinit -------------
|
||||||
# mysqld_safe --skip-grant-tables &
|
# mysqld_safe --skip-grant-tables &
|
||||||
```
|
```
|
||||||
|
|
||||||
[
|
[
|
||||||

|

|
||||||
][2]
|
][2]
|
Loading…
Reference in New Issue
Block a user