Ad Widget

Collapse

Failed to connect to database.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bisbell
    Junior Member
    • May 2008
    • 14

    #1

    Failed to connect to database.

    I have the zabbix.conf.php file in my ./htdocs/conf directory.
    Whenever I start zabbix_server I get the following message in my log file:
    5061:20080915:145003 Failed to connect to database: Error: Access denied for user 'root'@'localhost' (using password: NO) [1045]

    I was able to successfully run the database connection test during the initial setup, then downloaded the zabbix.conf.php file and put it the directory it asked my to. Why is zabbix_server trying to connect to MySQL as root?


    My zabbix.conf.php file looks like this:

    <?php
    /*
    ** ZABBIX
    ** Copyright (C) 2000-2005 SIA Zabbix
    **
    ** This program is free software; you can redistribute it and/or modify
    ** it under the terms of the GNU General Public License as published by
    ** the Free Software Foundation; either version 2 of the License, or
    ** (at your option) any later version.
    **
    ** This program is distributed in the hope that it will be useful,
    ** but WITHOUT ANY WARRANTY; without even the implied warranty of
    ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    ** GNU General Public License for more details.
    **
    ** You should have received a copy of the GNU General Public License
    ** along with this program; if not, write to the Free Software
    ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    **/

    global $DB_TYPE, $DB_SERVER, $DB_PORT, $DB_DATABASE, $DB_USER, $DB_PASSWORD, $IMAGE_FORMAT_DEFAULT;

    $DB_TYPE = "MYSQL";
    $DB_SERVER = "localhost";
    $DB_PORT = "0";
    $DB_DATABASE = "zabbix";
    $DB_USER = "zabbix";
    $DB_PASSWORD = "XXXXXX";

    $IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;
    ?>
  • Tenzer
    Senior Member
    • Nov 2007
    • 316

    #2
    The zabbix_server process doesn't use zabbix.conf.php for it's settings. They are only used by the webinterface. Check out /etc/zabbix/zabbix_server.conf instead, which is the usual place for the zabbix_server configuration file on most distros.

    Comment

    • bisbell
      Junior Member
      • May 2008
      • 14

      #3
      That was easy. Still seems a bit odd that zabbix created that file for me and asked me to put in the apache2/htdocs/conf directory- and it does nothing except make me feel a bit worried that I have a file with my DB username and password in the web servers document root.

      Comment

      • Tenzer
        Senior Member
        • Nov 2007
        • 316

        #4
        As said, that the zabbix.conf.php file is used by the webinterface as it's source for information on how to connect to the database. Since the zabbix_server and webinterface can be positioned on separate servers, it needs to be specified in separate files.

        Also, for security reasons it's not smart to have either of the two files readable for any other users than the one supposed to read from them.

        Comment

        • gregtompkins2
          Junior Member
          • Sep 2011
          • 5

          #5
          fresh install, at end of setup &quot;wizard&quot; sql errors

          I'm interested in zabbix to monitor dd-wrt wifi A/Ps. I have a fresh install, and I already pre-created the zabbix database, and also created a user called zabbix, password zabbix but at the end of the setup screens, I get a gnarly looking page with a bunch of errors on it (see screenshot). I would think that the setup wizard should be creating the tables its saying aren't there? How do I proceed?
          Attached Files

          Comment

          • Ori0n
            Member
            • Dec 2010
            • 35

            #6
            You probably should have started a new thread... but anyway, did you read http://www.zabbix.com/documentation/...on_from_source? Specifically, Section 4.3, Step 3


            Originally posted by gregtompkins2
            I'm interested in zabbix to monitor dd-wrt wifi A/Ps. I have a fresh install, and I already pre-created the zabbix database, and also created a user called zabbix, password zabbix but at the end of the setup screens, I get a gnarly looking page with a bunch of errors on it (see screenshot). I would think that the setup wizard should be creating the tables its saying aren't there? How do I proceed?

            Comment

            • gregtompkins2
              Junior Member
              • Sep 2011
              • 5

              #7
              I installed it through yast in OpenSuSe, shouldn't it have done all those manual steps for me?

              Thanks!

              Comment

              • Ori0n
                Member
                • Dec 2010
                • 35

                #8
                No idea, but probably. Check from the command line with
                Code:
                mysql -uroot -p zabbix
                and verify the tables exist. If they do, it might be a permissions issue. Did yast tell you what the zabbix db permissions were set to?

                Originally posted by gregtompkins2
                I installed it through yast in OpenSuSe, shouldn't it have done all those manual steps for me?

                Thanks!

                Comment

                Working...