Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides
https://forum.ivorde.com/

Mysql change column's default value
https://forum.ivorde.com/mysql-change-column-s-default-value-t120.html
Page 1 of 1

Author:  debuser [ Thu Aug 12, 2010 3:43 am ]
Post subject:  Mysql change column's default value

Code:
mysql> ALTER TABLE table_name MODIFY column_name INT DEFAULT 'some default value';


Remember that column type must be a char, varchar, enum or some other column type that supports default value. TEXT/BLOB columns do NOT support default values.

If an attempt to set a text column's default value a mysql error will be produced:
Quote:
ERROR 1101 (42000): BLOB/TEXT column 'preferences' can't have a default value

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/