Ad Widget

Collapse

Zabbix 1.4.1 MYSQL error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • grantwilson
    Junior Member
    • Jul 2007
    • 5

    #1

    Zabbix 1.4.1 MYSQL error

    Im trying to install Zabbix 1.4.1
    The 1.4 installation guide contains instructions for propagating MYSQL with data.
    The location for the file is create/mysql/schema.sql but this file does not exist

    There is however create/schema/mysql.sql

    I have tried to use this file to propagate mysql but I get the following error.

    cat mysql.sql | mysql -u root -p zabbix

    ERROR 1064 at line 153: 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 'serial ,
    nodeid bigint unsigned DEFAULT '0' NOT NULL,

    Please can someone help me as I cant go further than this.
  • aalexanderr
    Junior Member
    • Jul 2007
    • 26

    #2
    Originally posted by grantwilson
    Im trying to install Zabbix 1.4.1
    The 1.4 installation guide contains instructions for propagating MYSQL with data.
    The location for the file is create/mysql/schema.sql but this file does not exist

    There is however create/schema/mysql.sql

    I have tried to use this file to propagate mysql but I get the following error.

    cat mysql.sql | mysql -u root -p zabbix

    ERROR 1064 at line 153: 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 'serial ,
    nodeid bigint unsigned DEFAULT '0' NOT NULL,

    Please can someone help me as I cant go further than this.
    I think you need to give more info about mysql version..
    Try look here : http://www.zabbix.com/wiki/doku.php?...on_freebsd_6.2

    Comment

    • grantwilson
      Junior Member
      • Jul 2007
      • 5

      #3
      Hi aalexanderr,

      Im using Slackware 10.1, Mysql 4.0.27.

      Let me know if you need any more info.
      I was using the older versions of Zabbix fine but since I tried upgrading to the 1.4 and 1.4.1 versions I have had this problem. I have tried dropping and recreating and reinstalling a number of times.

      Comment

      • jonas21
        Junior Member
        • Jul 2007
        • 1

        #4
        Hi,

        had the same problem. Its cause is the "serial" statement at lines 154, 164 and 174.
        Serial is an alias for "BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE" and was introducted with mysql 5. Apparently the devenlopers overlooked this and are devenloping with a newer version than 3.22.

        To fix this just edit the mysql.sql file and search for "serial" (see lines above) and replace the word "serial" with "BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE".

        Thats it.

        Regards,
        Jonas

        Comment

        • grantwilson
          Junior Member
          • Jul 2007
          • 5

          #5
          Hi Jonas,

          Thanks very much, that fixed the problem. I did have an initial problem as I used pico without the -w switch the first time. Perhpas vi would have been the better choice.

          Thanks again
          Grant

          Comment

          • grantwilson
            Junior Member
            • Jul 2007
            • 5

            #6
            Hi Jonas,

            I have managed to now get to the web-based installer. Once I have completed it and I get to the login page I am presented with the following at the top of the login page. If I try login with the deafult user of admin and no password but I just get rejected, invalid user or wrong password.

            Here is the error that is displayed that the top.

            * Error in query [select u.* from users u where u.alias='guest' and (u.userid div 100000000000000)=0] [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 'div 100000000000000)=0' at line 1]
            * mysql_fetch_array(): supplied argument is not a valid MySQL result resource[/inet/webroot/zabbix/include/db.inc.php:411]
            * Error in query [select u.userid,u.alias,u.name,u.surname,u.url,u.refresh from users u where u.alias='admin' and u.passwd='d41d8cd98f00b204e9800998ecf8427e' and (u.userid div 100000000000000)=0] [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 'div 100000000000000)=0' at line 1]
            * mysql_fetch_array(): supplied argument is not a valid MySQL result resource[/inet/webroot/zabbix/include/db.inc.php:411]

            Comment

            • Alexei
              Founder, CEO
              Zabbix Certified Trainer
              Zabbix Certified SpecialistZabbix Certified Professional
              • Sep 2004
              • 5654

              #7
              The problem related to definition of serial columns was fixed. I'm not sure how to deal with the "div" problem.
              Alexei Vladishev
              Creator of Zabbix, Product manager
              New York | Tokyo | Riga
              My Twitter

              Comment

              • grantwilson
                Junior Member
                • Jul 2007
                • 5

                #8
                Thanks Alexei

                Comment

                • stritec
                  Junior Member
                  • Mar 2005
                  • 13

                  #9
                  I'm getting the same error:

                  PHP Code:
                  Error in query [select u.* from users u where u.alias='guest' and (u.userid div 100000000000000in (1) ] [You have an error in your SQL syntax near 'div 100000000000000) in (1) ' at line 1
                  mysql_fetch_array(): supplied argument is not a valid MySQL result resource[/var/www/html/include/db.inc.php:411
                  Note I'm running MySQL server version: 3.23.54


                  Any ideas what else I can try to login.

                  Comment

                  Working...