如何重置 Zoneminder 密码?

Ala*_*ito 3 xubuntu webapps

有没有办法在不重新安装应用程序的情况下重置监控应用程序zoneminder的管理员密码?我无法在文档中或通过谷歌搜索找到这些信息。

小智 6

1)登录mysql,例如MySQL服务器中的“root”用户:

$ mysql -u root -p
Enter password:
Run Code Online (Sandbox Code Playgroud)

2)输入你的密码然后输入,结果是:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6485
Server version: 5.5.29-0ubuntu0.12.04.1 (Ubuntu)
Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
Run Code Online (Sandbox Code Playgroud)

3)写: show databases;

结果是:

+--------------------+
| Database           |
+--------------------+

| information_schema |

| mysql              |

| performance_schema |

| test               |

| zm                 |
+--------------------+
Run Code Online (Sandbox Code Playgroud)

5 行(0.00 秒)"

4)这是您所有的数据库,说“zm”是您要查找的数据库。

写: use zm;

输出是:

   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
Run Code Online (Sandbox Code Playgroud)

5) 您需要更改用户的密码,以便在“zm”数据库中检查“用户”表的用户和其他部分。

写: select * from Users;

结果是:

+----+----------+-------------------------------------------+----------+---------+--------+--------+---------+----------+---------+--------+--------------+------------+
| Id | Username | Password                                  | Language | Enabled | Stream | Events | Control | Monitors | Devices | System | MaxBandwidth | MonitorIds |
+----+----------+-------------------------------------------+----------+---------+--------+--------+---------+----------+---------+--------+--------------+------------+

|  1 | admin    |  yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy |          |       1 | View   | Edit   | Edit    | Edit     | Edit    | Edit   |              |            |
|  2 | admin2    | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |          |       1 | View   | Edit   | Edit    | Edit     | None    | Edit   |              | 1          |
+----+----------+-------------------------------------------+----------+---------+--------+--------+---------+----------+---------+--------+--------------+------------+
Run Code Online (Sandbox Code Playgroud)

2 行(0.00 秒)"

6)然后假设您要更改“admin”用户的密码并将其留空,写:

mysql> update Users set Password="" where Username="admin";
Run Code Online (Sandbox Code Playgroud)

结果是:

   mysql> update Users set Password="" where Username="admin";
    Query OK, 1 row affected (0.00 sec)
    Rows matched: 1  Changed: 1  Warnings: 0
    mysql>
Run Code Online (Sandbox Code Playgroud)

请注意,所有这些“y”和“x”都将替换我的 zm 配置中密码的哈希值。因此,如果您在 zm 网页的选项菜单中选择了 hashed、plain 或 none:

“AUTH_RELAY 用于中继身份验证信息(?)散列纯无的方法”

在 MySQL 中,您将相应地看到密码,假设您会找到一个哈希值,或者您的密码是纯文本格式,或者如果根本没有密码,则为空白。我希望这对你有帮助。我在 Ubuntu 服务器 12.04 中使用 Zoneminder 1.25。


小智 5

不是将密码归零,而是使用 PASSWORD 函数对密码进行散列处理,因此请使用该函数来设置新密码。

update Users set Password=PASSWORD('newpass') where Username='admin';
Run Code Online (Sandbox Code Playgroud)