Ad Widget

Collapse

DB problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Frank_Ng
    Junior Member
    • Dec 2008
    • 6

    #1

    DB problem

    Hi there,

    I've got the error after completed installation, here is some error message on login page as following;

    Error in query [SELECT * FROM nodes WHERE nodetype=1 ORDER BY nodeid] [Table 'zabbix.nodes' doesn't exist]

    mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource[/htdocs/zabbix/include/db.inc.php:607]

    mysql_free_result(): supplied argument is not a valid MySQL result resource[/htdocs/zabbix/include/db.inc.php:609]

    Error in query [SELECT u.* FROM users u WHERE u.alias='guest' AND ((u.userid BETWEEN 000000000000000 AND 099999999999999))] [Table 'zabbix.users' doesn't exist]

    mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource[/htdocs/zabbix/include/db.inc.php:607]

    mysql_free_result(): supplied argument is not a valid MySQL result resource[/htdocs/zabbix/include/db.inc.php:609]

    Error in query [SELECT s.* FROM sessions s WHERE s.sessionid='' AND s.status=0 AND ((s.userid BETWEEN 000000000000000 AND 099999999999999))] [Table 'zabbix.sessions' doesn't exist]

    mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource[/htdocs/zabbix/include/db.inc.php:607]

    mysql_free_result(): supplied argument is not a valid MySQL result resource[/htdocs/zabbix/include/db.inc.php:609]

    Error in query [SELECT count(u.userid) as user_cnt FROM users u] [Table 'zabbix.users' doesn't exist]

    mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource[/htdocs/zabbix/include/db.inc.php:607]

    mysql_free_result(): supplied argument is not a valid MySQL result resource[/htdocs/zabbix/include/db.inc.php:609]

    Error in query [SELECT * FROM config WHERE ((configid BETWEEN 000000000000000 AND 099999999999999))] [Table 'zabbix.config' doesn't exist]

    mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource[/htdocs/zabbix/include/db.inc.php:607]

    mysql_free_result(): supplied argument is not a valid MySQL result resource[/htdocs/zabbix/include/db.inc.php:609]

    Error in query [SELECT u.userid,u.attempt_failed, u.attempt_clock, u.attempt_ip FROM users u WHERE u.alias='Admin'] [Table 'zabbix.users' doesn't exist]

    mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource[/htdocs/zabbix/include/db.inc.php:607]

    mysql_free_result(): supplied argument is not a valid MySQL result resource[/htdocs/zabbix/include/db.inc.php:609]

    Error in query [SELECT nextid FROM ids WHERE nodeid=0 AND table_name='auditlog' AND field_name='auditid'] [Table 'zabbix.ids' doesn't exist]

    Error in query [INSERT INTO auditlog (auditid,userid,clock,action,resourcetype,details, ip) VALUES (,0,1295895076,3,0,'Login failed [Admin]','10.10.1.2')] [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0,1295895076,3,0,'Login failed [Admin]','10.10.1.2')' at line 1]

    Error in query [SELECT * FROM profiles WHERE userid=0 AND ((profileid BETWEEN 000000000000000 AND 099999999999999)) ORDER BY userid ASC, profileid ASC] [Table 'zabbix.profiles' doesn't exist]

    mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource[/htdocs/zabbix/include/db.inc.php:607]

    mysql_free_result(): supplied argument is not a valid MySQL result resource[/htdocs/zabbix/include/db.inc.php:609]
  • Frank_Ng
    Junior Member
    • Dec 2008
    • 6

    #2
    It's is very urgent to me. Anyones knows how to solve it?

    Many tks .
    Frank

    Comment

    • Inc0
      Member
      • Dec 2010
      • 36

      #3
      Originally posted by Frank_Ng
      Hi there,

      I've got the error after completed installation, here is some error message on login page as following;

      Error in query [SELECT * FROM nodes WHERE nodetype=1 ORDER BY nodeid] [Table 'zabbix.nodes' doesn't exist]

      mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource[/htdocs/zabbix/include/db.inc.php:607]

      mysql_free_result(): supplied argument is not a valid MySQL result resource[/htdocs/zabbix/include/db.inc.php:609]

      Error in query [SELECT u.* FROM users u WHERE u.alias='guest' AND ((u.userid BETWEEN 000000000000000 AND 099999999999999))] [Table 'zabbix.users' doesn't exist]

      mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource[/htdocs/zabbix/include/db.inc.php:607]

      mysql_free_result(): supplied argument is not a valid MySQL result resource[/htdocs/zabbix/include/db.inc.php:609]

      Error in query [SELECT s.* FROM sessions s WHERE s.sessionid='' AND s.status=0 AND ((s.userid BETWEEN 000000000000000 AND 099999999999999))] [Table 'zabbix.sessions' doesn't exist]

      mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource[/htdocs/zabbix/include/db.inc.php:607]

      mysql_free_result(): supplied argument is not a valid MySQL result resource[/htdocs/zabbix/include/db.inc.php:609]

      Error in query [SELECT count(u.userid) as user_cnt FROM users u] [Table 'zabbix.users' doesn't exist]

      mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource[/htdocs/zabbix/include/db.inc.php:607]

      mysql_free_result(): supplied argument is not a valid MySQL result resource[/htdocs/zabbix/include/db.inc.php:609]

      Error in query [SELECT * FROM config WHERE ((configid BETWEEN 000000000000000 AND 099999999999999))] [Table 'zabbix.config' doesn't exist
      Did you import DB schema?

      Comment

      • nelsonab
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Sep 2006
        • 1233

        #4
        How did you create your database? Either some tables are missing or the user you are using to access the database does not have permissions to read from the appropriate tables. And as Inc0 mentioned how did you import/create this database?
        RHCE, author of zbxapi
        Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
        Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

        Comment

        • Frank_Ng
          Junior Member
          • Dec 2008
          • 6

          #5
          Originally posted by Inc0
          Did you import DB schema?
          Hi Inc0

          I think no, but I didn't see that step on installation doc.. And I'm new to zabbix, so how can I get it. Coz I just set up 2 server as Web and Zabbix in 1 box, MySQL in another box.

          Many thanks ur advise.

          Frank

          Comment

          • Frank_Ng
            Junior Member
            • Dec 2008
            • 6

            #6
            Originally posted by nelsonab
            How did you create your database? Either some tables are missing or the user you are using to access the database does not have permissions to read from the appropriate tables. And as Inc0 mentioned how did you import/create this database?
            Hi Nelson

            I created the database on another box, and passed the configure DB connection. I wonder that I did it wrong?
            Last edited by Frank_Ng; 24-01-2011, 17:10.

            Comment

            • Inc0
              Member
              • Dec 2010
              • 36

              #7
              My DB schema is in zabbix-1.8.3/create/data: this is NOT the webserver DocumentRoot it's the directory where you unpacked zabbix archive.
              I unpacked mine in /usr/src so the full path to the sql schema is /usr/src/zabbix-1.8.3/create/data and the file is called data.sql
              Check your paths and in data/ you should see 5 files .sql.
              I seem to understand that your instalaltion is quite new so I suggest you to empy the zabbix db from its tables and recreate the tables properly:
              Code:
              $ mysql -u zabbix_user - p zabbix_database < data.sql
              $ mysql -u zabbix_user - p zabbix_database < images_mysql.sql
              You can find more datailed instructions here: http://www.zabbix.com/documentation/...on_from_source

              Let us know if you have any other problem
              Last edited by Inc0; 24-01-2011, 17:13.

              Comment

              • Frank_Ng
                Junior Member
                • Dec 2008
                • 6

                #8
                Originally posted by Inc0
                My DB schema is in zabbix-1.8.3/create/data: this is NOT the webserver DocumentRoot it's the directory where you unpacked zabbix archive.
                I unpacked mine in /usr/src so the full path to the sql schema is /usr/src/zabbix-1.8.3/create/data and the file is called data.sql
                Check your paths and in data/ you should see 5 files .sql.
                I seem to understand that your instalaltion is quite new so I suggest you to empy the zabbix db from its tables and recreate the tables properly:
                Code:
                $ mysql -u zabbix_user - p zabbix_database < data.sql
                $ mysql -u zabbix_user - p zabbix_database < images_mysql.sql
                You can find more datailed instructions here: http://www.zabbix.com/documentation/...on_from_source

                Let us know if you have any other problem
                Hi Inc0

                Tks for ur advice and I try to copy and re-import to the DB box.

                Comment

                Working...