Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides

FAQ
It is currently Fri Dec 01, 2023 1:30 am


Mysql Application & Query Optimization, Questions, Indexes, Bugs.

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

Joined: Thu Aug 06, 2009 2:48 am
Posts: 105

Offline
 

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





Top
Display posts from previous:  Sort by  
E-mail friendPrint view

Topics related to - "Mysql change column's default value"
 Topics   Author   Replies   Views   Last post 
There are no new unread posts for this topic. Mysql - Change position of a column after another column

admin

1

4421

Fri Oct 08, 2010 1:41 am

sonee4 View the latest post

There are no new unread posts for this topic. Mysql: add column to table

debuser

1

4264

Fri Oct 08, 2010 1:38 am

sonee4 View the latest post

There are no new unread posts for this topic. Mysql add Unique index to a table column

debuser

0

3303

Fri Aug 06, 2010 10:01 am

debuser View the latest post

There are no new unread posts for this topic. Mysql remove column from an existing table

debuser

0

2331

Fri Aug 06, 2010 10:06 am

debuser View the latest post

There are no new unread posts for this topic. How to calculate mysql time difference between unix timestamp column and now() format

mandrei99

0

9667

Fri May 31, 2013 4:10 am

mandrei99 View the latest post

There are no new unread posts for this topic. Mysql change root password

mandrei99

0

2945

Tue Feb 10, 2015 6:50 pm

mandrei99 View the latest post

There are no new unread posts for this topic. Mysql> select records that have date/datetime column equal to today's date

admin

0

3988

Tue Nov 22, 2011 9:40 am

admin View the latest post

There are no new unread posts for this topic. MySql doesn't start: libexec/mysqld: File './mysql-bin.index' not found (Errcode: 13)

debuser

0

3219

Mon Feb 22, 2010 1:43 pm

debuser View the latest post

There are no new unread posts for this topic. Rename MySql table

debuser

1

2371

Fri Oct 08, 2010 1:36 am

sonee4 View the latest post

There are no new unread posts for this topic. MySql rename table

admin

2

2854

Mon Nov 28, 2011 3:39 am

Darwin View the latest post

 

Who is online
Users browsing this forum: No registered users and 0 guests
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
Jump to:  
cronNews News Site map Site map SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list


Delete all board cookies | The team | All times are UTC - 5 hours [ DST ]



phpBB SEO