Ad Widget

Collapse

Can not connect to remote mysql database with zabbix

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ptera
    Senior Member
    • Oct 2014
    • 109

    #1

    Can not connect to remote mysql database with zabbix

    I have two servers connected together with a direct connection on a private subnet.

    I can connect to the mysql from the zabbix server from console.

    Code:
    [root@zabbix ~]# mysql -u zabbix -p -h 10.64.64.2
    Enter password:
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 5
    Server version: 5.1.73 Source distribution
    
    Copyright (c) 2000, 2013, 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>
    But when I try to connect zabbix...
    22216:20150429:093013.356 [Z3001] connection to database 'zabbix' failed: [2003] Can't connect to MySQL server on '10.64.64.2' (13)
    22216:20150429:093013.357 database is down: reconnecting in 10 seconds

    Here is the config...

    Code:
    ### Option: DBHost
    
    DBHost=10.64.64.2
    
    DBName=zabbix
    
    DBUser=zabbix
    
    DBPassword=**********
    Is an actual hostname lookup required?

    What am I missing?
  • ptera
    Senior Member
    • Oct 2014
    • 109

    #2
    MYSQL permissions

    USER
    zabbix localhost *DC7B36BF0104C0689E7194EDACD91E6A96536DB2 None None
    zabbix 10.64.64.0/24 *DC7B36BF0104C0689E7194EDACD91E6A96536DB2 None None

    DATABASE

    zabbix zabbix 10.64.64.0/24 All
    zabbix zabbix localhost Select | Insert | Update | Delete | Create | Drop | References | Index | Alter | Create temp | Lock | Create View | Show View | Create Routine | Alter Routine | Execute | |

    No HOST PERMISSIONS

    I tried adding host permission but there was no change.

    Comment

    • ptera
      Senior Member
      • Oct 2014
      • 109

      #3
      remotely logged in...

      mysql> SHOW GRANTS FOR 'zabbix'@"10.64.64.1";
      +----------------------------------------------------------------------------------------------------------------+
      | Grants for [email protected] |
      +----------------------------------------------------------------------------------------------------------------+
      | GRANT USAGE ON *.* TO 'zabbix'@'10.64.64.1' IDENTIFIED BY PASSWORD '*DC7B36BF0104C0689E7194EDACD91E6A96536DB2' |
      | GRANT ALL PRIVILEGES ON `zabbix`.* TO 'zabbix'@'10.64.64.1' WITH GRANT OPTION |
      +----------------------------------------------------------------------------------------------------------------+
      2 rows in set (0.00 sec)

      Comment

      • ptera
        Senior Member
        • Oct 2014
        • 109

        #4
        bit by selinux

        Geesh it was still enabled on the server!

        Disabled and rebooted - problem solved

        Comment

        Working...