Mysql: Unable to drop a columns NULL default Running mariadb 10.3

I have a bunch of columns that were created by default as NULL defaults. I was asked by a third party integrator to remove the NULL defaults, but so far have been unsuccessful.

I first do:

mysql&gt; Describe Tablename;


I see my columns with Null defaults. e.g:

+--------------------------+---------------------+------+-----+---------+-------------------+
| Field                    | Type                | Null | Key | Default | Extra             |
+--------------------------+---------------------+------+-----+---------+-------------------+
| Tech ID                  | int(10) unsigned    | NO   | PRI | NULL    | auto_increment    |
| State                    | tinyint(1) unsigned | NO   |     | 1       |                   |
| Ref ProdID               | int(10) unsigned    | NO   | MUL | NULL    |                   |
| Prenom                   | varchar(50)         | YES  |     | NULL    |                   |


Then I do:

mysql&gt;ALTER TABLE Tablename ALTER COLUMN Prenom DROP DEFAULT;
Query OK, 0 rows affected (0.002 sec)
Records: 0  Duplicates: 0  Warnings: 0


Describe again shows that the Null default has not been removed from column Prenom. 

+--------------------------+---------------------+------+-----+---------+-------------------+
| Tech ID                  | int(10) unsigned    | NO   | PRI | NULL    | auto_increment    |
| State                    | tinyint(1) unsigned | NO   |     | 1       |                   |
| Ref ProdID               | int(10) unsigned    | NO   | MUL | NULL    |                   |
| Prenom                   | varchar(50)         | YES  |     | NULL    |                   |


Is it even possible to do this?
I suspect your integrator was asking to remove the NULL from the column.

First check there are no NULL columns:

SELECT * FROM TableName WHERE Prenom IS NULL


Or to set to empty string:

UPDATE TableName SET Prenom = "" WHERE Prenom IS NULL


Then NULL for the column can removed with:




select version();



| version()                                   |
| :------------------------------------------ |
| 10.3.11-MariaDB-1:10.3.11+maria~stretch-log |






create table TableName ( Prenom  varchar(50) )



✓






show create table TableName



Table     | Create Table                                                                                               
:-------- | :----------------------------------------------------------------------------------------------------------
TableName | CREATE TABLE `TableName` (`Prenom` varchar(50) DEFAULT NULL) ENGINE=InnoDB DEFAULT CHARSET=latin1






ALTER TABLE TableName MODIFY COLUMN Prenom varchar(50) NOT NULL



✓






show create table TableName



Table     | Create Table                                                                                           
:-------- | :------------------------------------------------------------------------------------------------------
TableName | CREATE TABLE `TableName` (`Prenom` varchar(50) NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=latin1



db&lt;>fiddle here