PDA

View Full Version : schema.sql error


magua
23-05-2005, 23:47
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
24-05-2005, 16:21
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.

Alexei
24-05-2005, 16:53
Version of ZABBIX? PostgreSQL or MySQL?

adrian
24-10-2005, 11:10
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