MYSQL table and utf8_unicode_ci

I try to create a table using encoding.

How to create SQL with the utf8_unicode_ci not utf8_general_ci

I attach UTF-8 but this is not utf8_unicode_ci

CREATE TABLE IF NOT EXISTS Pricing (
    `landrushFee_sunriseFee_landrushFee2_landrushFee3` VARCHAR(55) CHARACTER SET utf8,
    `Column_2` VARCHAR(47) CHARACTER SET utf8,
    `Column_3` VARCHAR(24) CHARACTER SET utf8,
    `Column_4` VARCHAR(40) CHARACTER SET utf8,
    `Column_5` VARCHAR(41) CHARACTER SET utf8,
    `Column_6` VARCHAR(11) CHARACTER SET utf8
);

Besides setting a character set, you can also specify a COLLATE attribute. Here is where you specify the utf8_unicode_ci. Since you don’t specify that property, MySQL defaults to utf8_general_ci.

CREATE TABLE IF NOT EXISTS Pricing (
    `landrushFee_sunriseFee_landrushFee2_landrushFee3` VARCHAR(55) CHARACTER SET utf8 COLLATE utf8_general_ci,
    `Column_2` VARCHAR(47) CHARACTER SET utf8,
    `Column_3` VARCHAR(24) CHARACTER SET utf8,
    `Column_4` VARCHAR(40) CHARACTER SET utf8,
    `Column_5` VARCHAR(41) CHARACTER SET utf8,
    `Column_6` VARCHAR(11) CHARACTER SET utf8
);

You can also specify your character set and collate on the entire table, just put it after your closing parenthesis…

CREATE TABLE IF NOT EXISTS Pricing (
    `landrushFee_sunriseFee_landrushFee2_landrushFee3` VARCHAR(55) CHARACTER SET utf8,
    `Column_2` VARCHAR(47) CHARACTER SET utf8,
    `Column_3` VARCHAR(24) CHARACTER SET utf8,
    `Column_4` VARCHAR(40) CHARACTER SET utf8,
    `Column_5` VARCHAR(41) CHARACTER SET utf8,
    `Column_6` VARCHAR(11) CHARACTER SET utf8
) CHARACTER SET utf8 COLLATE utf8_unicode_ci;

I would also take this opportunity to recommend that you take a look at utf8mb4 rather than utf8 as a character set. You may find that more comprehensive and flexible since it uses more bytes for characters.

I have checked also SQL file.
Is it also possible?

) ENGINE=InnoDB DEFAULT CHARSET=utf8_unicode_ci; COLLATE utf8_unicode_ci;

Take a look at this link below. It will show you how you can see all the character sets available on the system and allow you to pick whichever works.

https://dev.mysql.com/doc/refman/5.7/en/charset-mysql.html

Enjoy!

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.