Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any command in mysql that makes the following: if I create a new field and I set the type to TEXT than it automatically knows that by this I mean not latin1_swedish_ci but utf8_hungarian_ci charset.

I would like to apply this changes to the whole database without create a new table.

share|improve this question

migrated from Feb 1 '12 at 14:07

This question came from our site for professional and enthusiast programmers.

You can specify this option in a field definition - CREATE TABLE Syntax, ALTER TABLE Syntax. Try this ALTER statement -

  ADD COLUMN column2 VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_hungarian_ci DEFAULT NULL AFTER column1;
share|improve this answer
It it possible to do this globally and without create a new table? – 2astalavista Feb 1 '12 at 9:51
No, it is not possible to do it globally, the 'ALTER TABLE' statement can be used only for one specified table. So, you should execute 'ALTER TABLE' for each table, ...but you can change all table fields at a time;-) – Devart Feb 1 '12 at 10:10

The column level setting inherits from the table, database and instance settings

Globally, it is set at command line on startup.

I'd think carefully about the consequences of changing this because it affects more than the default for tables. For that, then look at ALTER DATABASE

share|improve this answer
ALTER TABLE `database_name`.`table_name`  
CHANGE `column_name` `column_name`  VARCHAR(255) CHARSET utf8 COLLATE utf8_hungarian_ci NULL;
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.