jda5
jda5

Reputation: 1446

How to set a default character set for a table in MySQL and MySQL Workbench?

I am forward engineering a MySQL database from an EER diagram in MySQL workbench, and am being shown the following error on the execution of the statement below:

ERROR: Error 1115: Unknown character set: 'DEFAULT'
CREATE TABLE IF NOT EXISTS `recipes_database_2`.`cleaned_string` (
          `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
          `string` VARCHAR(511) CHARACTER SET 'DEFAULT' NOT NULL,
          PRIMARY KEY (`id`),
          UNIQUE INDEX `string_UNIQUE` (`string` ASC) VISIBLE)
        ENGINE = InnoDB
        AUTO_INCREMENT = 1
        DEFAULT CHARACTER SET = DEFAULT

What can I change to fix this? I want the character set to be the one I set as the default for the database.

Upvotes: 1

Views: 93

Answers (1)

Mihe
Mihe

Reputation: 2318

Just don't specify the CHARACTER SET at all, then the

database character set and collation are used

as one can read from the documentation.

Upvotes: 2

Related Questions