Welcome to OCS Inventory NG community support, where you can ask questions and receive answers from other members of the community.

Please ask questions only in English or French.

Release 2.12.3 available

The official documentation can be found on https://wiki.ocsinventory-ng.org. Read it before asking your question.

Install Error [closed]

Good morning Comunity. I'm Trying to install OSC Server, and receive this error: Please help me!!!!

Please wait, database update may take up to 30 minutes......................
ERROR: line 176: query:[ CREATE TABLE snmp_storages ( ID INTEGER NOT NULL AUTO_INCREMENT DEFAULT NULL, SNMP_ID INTEGER DEFAULT NULL, DESCRIPTION VARCHAR(255) DEFAULT NULL, MANUFACTURER VARCHAR(255) DEFAULT NULL, NAME VARCHAR(255) DEFAULT NULL, MODEL VARCHAR(255) DEFAULT NULL, DISKSIZE INTEGER DEFAULT NULL, TYPE VARCHAR(255) DEFAULT NULL, SERIALNUMBER VARCHAR(255) DEFAULT NULL, FIRMWARE VARCHAR(255) DEFAULT NULL, PRIMARY KEY (ID, SNMP_ID) ) DEFAULT CHARSET=UTF8]failed
MySQL error: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead (err:1171)
.
ERROR: line 178: query:[ CREATE TABLE snmp_powersupplies ( ID INTEGER NOT NULL AUTO_INCREMENT, SNMP_ID INTEGER DEFAULT NULL, MANUFACTURER VARCHAR(255) DEFAULT NULL, REFERENCE VARCHAR(255) DEFAULT NULL, TYPE VARCHAR(255) DEFAULT NULL, SERIALNUMBER VARCHAR(255) DEFAULT NULL, DESCRIPTION VARCHAR(255) DEFAULT NULL, REVISION VARCHAR(255) DEFAULT NULL, PRIMARY KEY (ID, SNMP_ID) ) DEFAULT CHARSET=UTF8]failed
MySQL error: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead (err:1171)
.....

MySQL config file successfully written (using root account)

Existing database updated

Database engine checking........................

Database engine successfully updated (1 table(s) altered)

ERROR: The installer ended unsuccessfully, rerun install.php once problems are corrected
closed with the note: This question is Answered and Solved
in OCS Inventory NG server for Unix by (160 points)
closed by

1 Answer

0 votes
The solution is simple.

change the next

CREATE TABLE snmp_storages (
  ID INTEGER NOT NULL AUTO_INCREMENT DEFAULT NULL,
  SNMP_ID INTEGER DEFAULT NULL,
  DESCRIPTION VARCHAR(255) DEFAULT NULL,
  MANUFACTURER VARCHAR(255) DEFAULT NULL,
  NAME VARCHAR(255) DEFAULT NULL,
  MODEL VARCHAR(255) DEFAULT NULL,
  DISKSIZE INTEGER DEFAULT NULL,
  TYPE VARCHAR(255) DEFAULT NULL,
  SERIALNUMBER VARCHAR(255) DEFAULT NULL,
  FIRMWARE VARCHAR(255) DEFAULT NULL,
  UNIQUE (ID, SNMP_ID)
) DEFAULT CHARSET=UTF8;

CREATE TABLE snmp_powersupplies (
  ID INTEGER NOT NULL AUTO_INCREMENT,
  SNMP_ID INTEGER DEFAULT NULL,
  MANUFACTURER VARCHAR(255) DEFAULT NULL,
  REFERENCE VARCHAR(255) DEFAULT NULL,
  TYPE VARCHAR(255) DEFAULT NULL,
  SERIALNUMBER VARCHAR(255) DEFAULT NULL,
  DESCRIPTION VARCHAR(255) DEFAULT NULL,
  REVISION VARCHAR(255) DEFAULT NULL,
  UNIQUE (ID, SNMP_ID)
) DEFAULT CHARSET=UTF8;
by (160 points)
 
Powered by Question2Answer
...