Ad Widget

Collapse

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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vitS
    Member
    • Apr 2021
    • 43

    #1

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

    Hi,
    I created UserParameter in zabbix_agent.conf mysql.query[*] (echo "query" mysql -N -u zabbix -p pass)
    In /usr/local/etc/zabbix Created .mycnf:
    [client]
    user = zabbix
    password = pass

    User zabbix created with all priveleges

    If to check mysql -u zabbix -p
    I can login, and select

    But from Test on Item ( In Item I put mysql.query Is it correct? )
    Server we have 5.0.3, but I found that client is on version 4.4.4 ( Can it be the problem? )

    Thanks,
  • tomeksup
    Junior Member
    • Apr 2021
    • 14

    #2
    Are you use sudo ?

    Comment

    • vitS
      Member
      • Apr 2021
      • 43

      #3
      Hi what do You mean use sudo?

      Just checked: Entered to server, where zabbix agen placed -

      sudo su and tried mysql -u zabbix -p

      Working fine

      Ctrl + D (logout)

      mysql -u zabbix -p

      The same results - everything fine, but fro zabbix GUI still access denied

      Thanks,

      Comment

      • tomeksup
        Junior Member
        • Apr 2021
        • 14

        #4
        Have you add correct permission to database for user used in GUI ?

        Comment

        • vitS
          Member
          • Apr 2021
          • 43

          #5
          Hi,

          What do You mean correct permissions?

          Do You mean Grants to zabbix user?

          Due to my error - I have such Grants
          +---------------------------------------------------------------------------------------------+
          | Grants for zabbix@localhost |
          +---------------------------------------------------------------------------------------------+
          | GRANT PROCESS, SHOW DATABASES, REPLICATION CLIENT, SHOW VIEW ON *.* TO 'zabbix'@'localhost' |
          | GRANT SELECT ON `sys`.* TO 'zabbix'@'localhost' |
          | GRANT SELECT ON `performance_schema`.* TO 'zabbix'@'localhost' |
          | GRANT SELECT ON `piearsta_web`.* TO 'zabbix'@'localhost' |
          +---------------------------------------------------------------------------------------------+

          Also i created user zabbix@% and I have such grants there

          +-------------------------------------------------------------------------------------+
          | Grants for zabbix@% |
          +-------------------------------------------------------------------------------------+
          | GRANT PROCESS, SHOW DATABASES, REPLICATION CLIENT, SHOW VIEW ON *.* TO 'zabbix'@'%' |
          | GRANT SELECT ON `performance_schema`.* TO 'zabbix'@'%' |
          | GRANT SELECT ON `piearsta_web`.* TO 'zabbix'@'%' |

          FLUSH PRIVILEGES; //were executed

          What permissions from GUI can be more?

          Thanks,

          Comment

          • tomeksup
            Junior Member
            • Apr 2021
            • 14

            #6
            I used 'zabbix'@'localhost' |

            Comment

            • vitS
              Member
              • Apr 2021
              • 43

              #7
              Hi,

              What do You mean You used?

              Where should I declare it? I mean like zabix@localhost.

              What I did: I put on agentd.conf In Userparameter: ....mysql -N -u zabbix -p pass)

              I didn't use localhost just zabbix and created 2 users zabbix@localhost and zabbix@% ?

              Zabbix decided by it is own zabbix@localhost. If I correctly understood zabbix through port 10050 - go to agent (on other server) and on on other server by zabbix@localhost connects to DB.

              Thanks,

              Comment

              • vitS
                Member
                • Apr 2021
                • 43

                #8
                Hi,

                Ok, I found the issue:

                In UserParameter on agent I wrote: mysql.query[*] (echo "query" mysql -N -u zabbix -p pass)

                Which is not correct - should be:

                mysql.query[*] (echo "query" mysql -N -uzabbix -ppass)

                Thank You,

                Comment

                • thierry
                  Member
                  • Nov 2017
                  • 41

                  #9
                  hi,
                  could you explain please?

                  we don't see what is code, comment, parameters ....

                  Comment

                  Working...