If you want your unique index to throw an error when a two rows would be the same if you disregard NULL columns (and don't want to use triggers from Satyam's answer) you can do something like this
CREATE TABLE `test` (
`Field1` INTEGER,
`Field2` INTEGER
);
CREATE UNIQUE INDEX `ix` ON `test` (
`Field1`,
`Field2`
);
INSERT INTO `test`(`Field1`,`Field2`) VALUES (1,NULL);
INSERT INTO `test`(`Field1`,`Field2`) VALUES (1,NULL); -- This shouldn't be allowed
DROP INDEX IF EXISTS `ix`;
CREATE UNIQUE INDEX `ix2` ON `test` (
`Field1`,
ifnull(`Field2`, 0) --use this instead
); --will fail