Where can I change the default character set of a table in MySQL Workbench's data modeling tool?

Franck Dernoncourt picture Franck Dernoncourt · Sep 24, 2013 · Viewed 36.9k times · Source

I created a database schema using MySQL Workbench's data modeling tool. When it generates the SQL CREATE statements, it generates "default character set = latin1;" for some tables, e.g.:

-- -----------------------------------------------------
-- Table `moocdb`.`resource_types`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `moocdb`.`resource_types` (
  `resource_type_id` INT(11) NOT NULL,
  `resource_type_name` VARCHAR(20) CHARACTER SET 'utf8' NOT NULL,
  PRIMARY KEY (`resource_type_id`))
ENGINE = InnoDB
default character set = latin1;

How can I change it to the schema's default character set? (I found where to change the schema's default character set, but not the table's)


As a side note:

Note: Since MySQL 5.5.3 you should use utf8mb4 rather than utf8. They both refer to the UTF-8 encoding, but the older utf8 had a MySQL-specific limitation preventing use of characters numbered above 0xFFFD.

Answer

Mike Lischke picture Mike Lischke · Sep 24, 2013

You can set the used charset/collation combination in the table editor. You have to expand the header (which is by default collapsed to save space) to be able to change it. See this screenshot:

enter image description here