-->

DEVOPSZONES

  • Recent blogs

    How To Reset Zabbix Admin Password?

     How To Reset Zabbix Admin Password?

    How To Reset Zabbix Admin Password

    To recover Zabbix Admin password you need to follow the following Steps.

    1. Login to Zabbix MySQL/MariaDB Password.

    Use the following command to login the MySQL/MariaDB server as root. Please provide the password for root user.

    # mysql -uroot -p


    How To Reset Zabbix Admin Password?


    2. After entering the password, use the following MySQL commands to reset the Zabbix Admin user password.

    For Zabbix version < 5.4

    mysql> use zabbix;

    mysql> update zabbix.users set passwd=md5('zabbix') where alias='Admin';

    mysql> flush privilages; 
    mysql> quit;


    How To Reset Zabbix Admin Password

    You need to use this command for Zabbix version 5.4:

    Error:
    mysql> update zabbix.users set passwd=md5('zabbix') where alias='Admin';
    ERROR 1054 (42S22): Unknown column 'alias' in 'where clause'

    Solved:
    mysql> update zabbix.users set passwd=md5('zabbix') where username='Admin';
    Query OK, 1 row affected (0.00 sec)


    You need to use this command for Zabbix version 6:

    To change the admin password in Zabbix 6 with MySQL as the database, you can follow these steps:


    1. Log in to the server where Zabbix is installed.


    2. Open a command prompt or terminal and log in to the MySQL server as the root user or a user with sufficient privileges.


       ```

       mysql -u root -p

       ```


    3. Enter the password for the MySQL root user when prompted.


    4. Switch to the Zabbix database.


       ```

       use zabbix;

       ```


    5. Update the password for the admin user.


       ```

    update users set passwd=md5('new_password') where alias='Admin';


       Replace 'new_password' with the desired password for the admin user.

    Updated:

     The md5 doesn't work anymore. The password is now encryped with bcrypt so run it through bcrypt first
    Example: You can use web based tool too for bcrypt.

     htpasswd -bnBC 10 "zabbix" password | tr -d ':\n'


    then in mysql, example:

    syntax:

    update zabbix.users set passwd=(' brcypt password')  where userid='1';
    update zabbix.users set passwd=('$2y$10$zH.KFQELRDLKlExVq18Z.eVty9yLGL7cHM9B9vTuXX1oDTcWvYALK')  where userid='1';

       ```


    6. Flush the privileges to ensure the changes take effect.


       ```

       flush privileges;

       ```


    7. Exit the MySQL prompt.


       ```

       exit;

       ```


    After following these steps, the admin password in Zabbix 6 should be changed to the new password you specified. Make sure to use a strong password to ensure the security of your Zabbix installation.

    In our example, we changed the Admin user password to zabbix.





    8 comments:

    1. hi, i've a error when i try the query:
      ERROR 1054 (42S22): Unknown column 'alias' in 'field list'
      maybe in zabbix 5.4 is change?
      thank you

      ReplyDelete
      Replies
      1. Hi Gabriele,
        Sorry , Could not get back to you on time. Completely missed this comment.

        Delete
    2. hi, i've a error when i try the query:
      ERROR 1054 (42S22): Unknown column 'alias' in 'field list'
      maybe in zabbix 5.4 is change?
      thank you

      ReplyDelete
    3. I bro!

      You need to use this command for Zabbix version 5.4:

      Error:
      mysql> update zabbix.users set passwd=md5('zabbix') where alias='Admin';
      ERROR 1054 (42S22): Unknown column 'alias' in 'where clause'

      Solved:
      mysql> update zabbix.users set passwd=md5('zabbix') where username='Admin';
      Query OK, 1 row affected (0.00 sec)


      See you later!

      ReplyDelete
    4. it still didnt changed

      ReplyDelete
    5. you dont need to run flush privileges; -- do you actually know anything about zabbix and mysql? i dont think so.

      ReplyDelete
      Replies
      1. You certainly do need that. For zabbix skills, thats your perspective.
        The FLUSH PRIVILEGES command in MySQL reloads the grant tables in your MySQL database. This enables changes to take effect without stopping and restarting MySQL.

        The FLUSH statement has several variant forms that clear or reload various internal caches, flush tables, or acquire locks.

        Delete