How to Remove a Default Value to a Column in MySQL

To remove a default value to a column in MySQL, use the ALTER TABLE ... ALTER ... DROP DEFAULT command:

--Example: Products have a default stock of 0
ALTER TABLE products ALTER COLUMN stocks integer DROP DEFAULT;

--Example: Products are available by default (removed optional COLUMN keyword)
ALTER TABLE products ALTER available DROP DEFAULT;
database icon
From MySQL query to chart to Slack in seconds
Get to answers faster, together, with PopSQL and MySQL