Skip to content
Advertisement

How to change column charset, set as not null and add a default value?

The column contains some rules such as not nullable and character_set_name is latin1 and I should write a query to update only the character_set_name.

field: name

type: varchar(255)

null: NO

default: JACK

character_set_name: latin1

Is there any way to do this in one query?

if I run only the first query, ‘name’ will accept null values and default=null.

Advertisement

Answer

yes, simpy write them together

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement