简体   繁体   中英

MySQL Workbench - Collation reverts to Schema Default

This seems like I'm just missing something trivial, but I'm not able to change the collation of a table from Schema Default. Selecting anything from the dropdown just reverts to Schema Default.

I have utf8 - utf8_general_ci set as the schema collation, which I can change without issue.

However, even though the schema default is set to utf8_general_ci and the tables supposedly use the schema default, when I export the SQL CREATE script and import it in phpMyAdmin, the collation is set to latin1_swedish_ci.

The script itself contains a correct CREATE SCHEMA statement:

CREATE SCHEMA IF NOT EXISTS 'my_table' DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ;

But the CREATE TABLE statements only include the engine assignment.

I'm using MySQL Workbench 6.0, and the server I'm using is running MySQL 5.5.34 and phpyMyAdmin 3.4.11.1. The server default collation is also utf8_general_ci.

EDIT: As I suspected, something stupid. I created the database via the cPanel beforehand rather than through the SQL script, and the default collation was set to latin1_swedish_ci.

However, that doesn't explain why I couldn't set specific collations on the tables in Workbench.

如果没有给出他们应该给出的方式,那么整理肯定会恢复为Schema Default。

Where did you set the collation in MySQL Workbench actually? There are 2 places, one in modeling and one for live objects (existing db objects in a server).

If the latter, did you apply your changes?

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