Ad Widget

Collapse

Strange MySQL behavior : Access denied for user '3306'@'localhost'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • t.heroult
    Junior Member
    • Jun 2021
    • 6

    #1

    Strange MySQL behavior : Access denied for user '3306'@'localhost'

    Info
    Zabbix server 5.4 (Debian 10)
    host :
    - windows 2016 std
    - MySQL 5.7
    - Zabbix agent 2
    - Template : MySql by Zabbix agent

    Hi folks !
    I'm rather new to zabbix. I discovered it few weeks ago and I'm currently setting it in our information service !
    I managed to configure several hosts with the MySql by Zabbix agent (on Windows and Linux OS).

    But, I have a strange issue, I'm working on 2 similar servers (test and prod).
    On one of them, I managed to configure MySql template quite easily, but on the other, in the zabbix agent log, I find this :
    Code:
     [Mysql] Cannot fetch data: Error 1045: Access denied for user '3306'@'localhost' (using password: NO).
    The macros are set
    {$MYSQL.DSN}=tcp://localhost:3306
    {$MYSQL.USER}=zbx_monitor
    {$MYSQL.PASSWORD})= ****
    The zbx_monitor account is correctly set in the MySql database (I manage to log into the db with this login).

    It seems the agent is trying to use the port instead of the user login.
    I'm really stuck with this.
    Some help would be great !

    Tom
  • LenR
    Senior Member
    • Sep 2009
    • 1005

    #2
    Can you see the composed server conf file and the startup log? Maybe clues in one of those.

    Comment

    • t.heroult
      Junior Member
      • Jun 2021
      • 6

      #3
      Hi LenR

      I don't know what is the "composed" server conf file. Can you explain, please ?

      I checked in the server log too, and there's nothing more, just said in another way.
      In the server log, there is :
      Code:
       28911:20210622:160104.772 item "MYREALSERVERNAME:mysql.get_status_variables["{$MYSQL.HOST}","{$MYSQL.PORT}"]" became not supported: Cannot fetch data: Error 1045: Access denied for user '3306'@'localhost' (using password: NO).

      Comment

      • t.heroult
        Junior Member
        • Jun 2021
        • 6

        #4
        Forget it, I started back from scratch and it's OK now
        At the beginning, I cloned the host in Zabbix, maybe there's been a trick...

        So we can close

        Thanx LenR
        Last edited by t.heroult; 22-06-2021, 16:47.

        Comment

        • aaxvig
          Junior Member
          • Nov 2025
          • 3

          #5
          I found myself here with the same message. An apparent mismatch in parameter order somewhere such that the port ends up going in the user field?

          I believe I resolved this by switching from the template "MySQL by Zabbix agent" to "MySQL by Zabbix agent 2". I am of course running Zabbix Agent 2 on the host to be monitored.

          Comment

          Working...