ALTER TABLE `pages` MODIFY `views` INT(11) NOT NULL DEFAULT 0
Trying to alter a column in a table which is currently allows NULL and has no default.
I want it to be NOT NULL and have a default of 0.
The Error message I get is
Invalid use of NULL value
update pages set views to be 0 where views is null1st then run your alter. Pretty sure default 0 applies to new rows, not existing.