Ad Widget

Collapse

schema.sql error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • magua
    Junior Member
    • May 2005
    • 5

    #1

    schema.sql error

    When runing schem.sql script i get the following error

    ERROR 1067 (42000) at line 402: Invalid default value for 'userid'

    And as a result the script does not create all the tables.
    Here is the listing of tables created.
    mysql> SHOW TABLES;
    +------------------+
    | Tables_in_zabbix |
    +------------------+
    | actions |
    | alarms |
    | alerts |
    | config |
    | functions |
    | graphs |
    | graphs_items |
    | groups |
    | history |
    | history_str |
    | hosts |
    | hosts_groups |
    | items |
    | media |
    | media_type |
    | services |
    | services_links |
    | sessions |
    | sysmaps |
    | sysmaps_hosts |
    | sysmaps_links |
    | trigger_depends |
    | triggers |
    | users |
    +------------------+
    24 rows in set (0.01 sec)

    Is there a fix for this?
  • magua
    Junior Member
    • May 2005
    • 5

    #2
    RE: schema.sql error

    The fix was simple
    1. Modify section of the schema.sql script (starts at line 403)
    that creates the "rights" tables and change the
    userid line from

    userid int(4) DEFAULT '' NOT NULL,

    To

    userid int(4),

    and then run the script.

    Comment

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

      #3
      Version of ZABBIX? PostgreSQL or MySQL?
      Alexei Vladishev
      Creator of Zabbix, Product manager
      New York | Tokyo | Riga
      My Twitter

      Comment

      • adrian
        Junior Member
        • Oct 2005
        • 5

        #4
        bug in mysql/schema.sql line 454 (userid)

        I've just got this doing a from scatch install of 1.1beta2 on mysql5.

        cat schema.sql | mysql -uzabbix -pzabbix zabbix
        ERROR 1067 (42000) at line 454: Invalid default value for 'userid'

        appropriate bit of sql:

        CREATE TABLE rights (
        rightid int(4) NOT NULL auto_increment,
        userid int(4) DEFAULT '' NOT NULL,
        name char(255) DEFAULT '' NOT NULL,
        permission char(1) DEFAULT '' NOT NULL,
        id int(4),
        PRIMARY KEY (rightid)
        ) type=InnoDB;

        I've just removed the DEFAULT '' part and that's fixed it (and no other errors either).

        Thanks,

        Adrian

        Comment

        Working...