简体   繁体   中英

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.

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM