Ad Widget

Collapse

Access denied for user 'replace_user'@'localhost' (using password: YES)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • patsonbass
    Junior Member
    • Oct 2020
    • 1

    #1

    Access denied for user 'replace_user'@'localhost' (using password: YES)

    Hello,

    I am new in ZABBIX, I downloaded and installed a ZABBIX appliance, today.

    I tried to launch the web application, but i encounter this error message: Access denied for user 'replace_user'@'localhost' (using password: YES).

    Please can you help?


    Kind Regards,
  • gurulee
    Junior Member
    • Jan 2021
    • 1

    #2
    I have the same problem after just downloading zabbix_appliance-5.2.4-qcow2.tar and importing it into my KVM. At first boot I go to the webUI and I get the error:
    Click image for larger version

Name:	Selection_052.png
Views:	31815
Size:	10.7 KB
ID:	417560

    Comment

    • Jun.Liu
      Member
      • Apr 2007
      • 91

      #3
      I met the same problem when importing a zabbix appliance to KVM. after some investigation, it looked like some information and data are missing in zabbix configuration and database. I resolved the problem with the below steps
      1. stop the zabbix server with the command 'systemctl stop zabbix-server'.
      2. modify the `/etc/zabbix/zabbix_server.conf`, change the 'DBUser' to 'zabbix_srv' and 'DBPassword' to your selected.
      3. modify the `/etc/zabbix/web/zabbix.conf.php`, change the `$DB['USER']` to 'zabbix_web', and `$DB['PASSWORD']` to your selected.
      4. login the MySQL and alter both users zabbix_srv and zabbix_web's password to your selected.
      5. start the zabbix server with command: `systemctl start zabbix-server`.
      The problem should be solved if everything goes well. but if you encountered the below error msg in the zabbix_server.log as I did:

      1656:20210314:045850.835 cannot use database "zabbix": its "users" table is empty (is this the Zabbix proxy database?)
      that means some data are missed in the 'users' table of the zabbix db. You should drop zabbix database, create it again and populate it with the DB script according to the zabbix documents.


      after the above steps. my problem was solved. hope it can help.

      Comment

      • Hasabadusa23
        Junior Member
        • Dec 2023
        • 11

        #4

        Thank you very much for this information. Its terrible that zabbix is not writing this in the user manual...
        The zabbix installation, is it Appliance or anything else is always a pain in the ass and the use of google for 8 hours till every error is gone which could have been fixed if they would EVER test the appliances and tutorials they write...

        I'm stuck right now here after I did the changes u recommended:

        Code:
        zabbix-server.service: Can't open PID file /run/zabbix/zabbix_server.pid
        
        1389:20240116:145349.567 using configuration file: /etc/zabbix/zabbix_server.conf
        1389:20240116:145349.577 cannot use database "zabbix": its "users" table is empty (is this the Zabbix proxy database?)​
        Why ? why do I use an appliance where I expect everything is working and I have to maybe re-initialise the database with the script ?
        Last edited by Hasabadusa23; 16-01-2024, 16:55.

        Comment

        • Hasabadusa23
          Junior Member
          • Dec 2023
          • 11

          #5
          I dropped the zabbix db, created a new zabbix db and then reinitialised the database with

          Code:
          zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix_srv -p zabbix
          Now it's working.


          Please Zabbix Team add this to your tutorial.

          Comment

          • Hasabadusa23
            Junior Member
            • Dec 2023
            • 11

            #6
            The next error (OF COURSE there are more errors on this appliance...) is the message at the webinterface system information:

            Code:
            zabbix Unsupported charset or collation for tables
            So you also need to fix this with this tutorial:

            https://www.zabbix.com/documentation...b_charset_coll

            OF OCURSE it is not working completly because it doesnt change the charset or collation for the tables but JUST for the database...

            So you need to convert the collation for every table.

            The command

            Code:
            SELECT CONCAT('ALTER TABLE ',TABLE_SCHEMA,'.',TABLE_NAME,' CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;') AS alter_sql FROM information_schema.tables WHERE table_schema = 'zabbix';
            is showing you changes, but OF COURSE it is not working...

            So I needed to write a script with chatgpt that alters every table step by step

            Code:
            #!/bin/bash
            
            # Verbindungsparameter für MySQL
            MYSQL_USER="USERNAME"
            MYSQL_PASSWORD="PASSWORD"
            MYSQL_DATABASE="zabbix"
            
            # SQL-Abfrage, um die 'ALTER TABLE'-Anweisungen zu generieren
            SQL_QUERY=$(mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -Nse "SELECT CONCAT('ALTER TABLE ', table_name, ' CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;') FROM information_schema.tables WHERE table_schema = '$MYSQL_DATABASE';")
            
            # Ausführung der generierten 'ALTER TABLE'-Anweisungen
            echo "$SQL_QUERY" | mysql -u$MYSQL_USER -p$MYSQL_PASSWORD $MYSQL_DATABASE
            ​

            Comment

            • Hasabadusa23
              Junior Member
              • Dec 2023
              • 11

              #7
              Oh and for the next error with the numeric values you need to do this




              My config file was here

              Code:
              /etc/zabbix/web/zabbix.conf.php
              not sure what you mean with

              Code:
              /ui/conf/zabbix.conf.php
              Never saw a directory with the name "ui"
              Last edited by dimir; 19-12-2024, 15:52.

              Comment

            • Armaro
              Junior Member
              • Jan 2024
              • 1

              #8

              I followed this recipe:

              Let's learn how to install the zabbix server already configured and ready for use with the zabbix appliance on VirtualBox.


              Got the same error, googled it and ended up here, quickly realized that something banally simple was the reason for the error message.

              Deleted the virtual machine and restarted with a clean slate.

              Followed the write-up this time and then it worked!

              The problem was that I was a bit too quick to log in to the web interface, first log in to the console then the web interface :-)

              Comment

              • pbpm
                Junior Member
                • Nov 2010
                • 5

                #9
                Originally posted by Armaro
                I followed this recipe:

                Let's learn how to install the zabbix server already configured and ready for use with the zabbix appliance on VirtualBox.

                ...
                Many thanks for your suggestion Armaro of only following what is in the recipe you linked.

                Not sure about the reasons but, I thought the problem was into the Network Adapter setting, but probably is only time needed to run the initial configuration script for appliance, particularly Zabbix.
                I have struggled last days trying to understand why db zabbix was not created and so relative users, zabbix_srv and zabbix_web.

                It's really enough to follow what said into

                Zabbix Appliance on VirtualBox » Simplificando Redes
                Let's learn how to install the zabbix server already configured and ready for use with the zabbix appliance on VirtualBox.


                Thank for sharing

                pm
                Last edited by pbpm; 11-09-2024, 16:30.

                Comment

                • dimir
                  Zabbix developer
                  • Apr 2011
                  • 1080

                  #10
                  It's sad to see all the victims here but the actual reason for issues like that is that something went wrong during the deployment of the image. The "replace_user" shouldn't even be visible to a user. The deployment process has steps to replace it with real user name. All a user needs to know is documented here:



                  We should probably add a section telling what to do in situations like this, when something gone wrong. I'm glad that you fixed all the "unfinished" jobs by yourself, well done. Sorry it took you so much time.

                  For all the other victims:

                  if you encounter an issue like this (something is definitely wrong) please just remove everything and re-deploy the image, it should help in most cases.

                  UPD: created an issue: https://support.zabbix.com/browse/ZBX-25771
                  Last edited by dimir; 19-12-2024, 16:25.

                  Comment

                  • dimir
                    Zabbix developer
                    • Apr 2011
                    • 1080

                    #11
                    Thanks to our documentation team there is now a new section "Troubleshooting":

                    Comment

                    Working...