Hello MySQL Forums;
Question 1: Should I use a). NULL column default or b). "None" (NOT NULL) column default with a text string as the default value for a VARCHAR column in a MySQL table?
- If I change the VARCHAR column to 'None' using phpMyAdmin (MySQL sets the column to "NOT NULL") I must insert at least one character for the default or the INSERT clause won't work. A popup appears at the Default heading in phpMyAdmin that says "For default values ... enter text in the following format: a."
- If I change the VARCHAR column to 'NULL' the INSERT clause will work.
I have got a database hosting that uses MySQL. The parameters for the database are as follows:
- MySQL server version: 5.6.30
- Shared hosting GoDaddy
- strict SQL mode
The MySQL Manual says that if the column is set to NOT NULL and there is no default value MySQL will define the column with an explicit DEFAULT NULL clause. However, if I export the table it is defined as NOT NULL with no default clause.
The Manual says if the column is set to NOT NULL and if MySQL is set in strict mode the INSERT clause won't work if there is no value for that column.
http://dev.mysql.com/doc/refman/5.6/en/data-type-defaults.html
Thank you in advance.