mysql 忘记密码

Mariadb 5.5 需要更新 password 字段。

sudo mysqld_safe --skip-grant-tables &


MariaDB [mysql]> UPDATE user SET password=PASSWORD(''),authentication_string='' WHERE user='root';
Query OK, 5 rows affected (0.00 sec)
Rows matched: 5  Changed: 5  Warnings: 0

MariaDB [mysql]> select user, host, password,authentication_string from user;
+--------+--------------+----------+-----------------------+
| user   | host         | password | authentication_string |
+--------+--------------+----------+-----------------------+
| root   | localhost    |          |                       |
| root   | 10-0-160-127 |          |                       |
| root   | %            |          |                       |
| root   | ::1          |          |                       |
| root   | 127.0.0.1    |          |                       |
| zstack | localhost    |          |                       |
| zstack | %            |          |                       |
+--------+--------------+----------+-----------------------+
posted @ 2024-12-02 16:57  小马快跑3  阅读(1)  评论(0编辑  收藏  举报