MySQL 工作台字符集
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6860086/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
MySQL Workbench charset
提问by Math
Does there exist any way to change the MySQL Workbench charset? My schema uses UTF-8 and when I view the table data (saved as UTF-8) or add data manually, it appears with charset errors, probably MySQL Workbench uses LATIN1.
是否有任何方法可以更改 MySQL Workbench 字符集?我的架构使用 UTF-8,当我查看表数据(另存为 UTF-8)或手动添加数据时,出现字符集错误,可能 MySQL Workbench 使用 LATIN1。
回答by sbrbot
I think OP was asking about charset that Workbench uses in its editor and how to setup Workbench to use UTF-8 in GUI - not how to setup default charset used for database table in Workbench. At the moment in Workbench one can set database table charset but regardless of it Workbench will in it's GUI represent data using Latin1 charset!!! Also inserting data into UTF-8 tables through Workbench will result with wrong chars in database. I don't know either how to make Workbench deal with UTF-8 in its GUI.
我认为 OP 是在询问 Workbench 在其编辑器中使用的字符集,以及如何设置 Workbench 以在 GUI 中使用 UTF-8 - 而不是如何设置用于 Workbench 中数据库表的默认字符集。目前在 Workbench 中可以设置数据库表字符集,但无论如何 Workbench 将在其 GUI 中使用 Latin1 字符集表示数据!!!此外,通过 Workbench 将数据插入到 UTF-8 表中会导致数据库中出现错误的字符。我也不知道如何让 Workbench 在其 GUI 中处理 UTF-8。
回答by John Mayor
In "Model Overview", under "Physical Schemata", right-click the database and select "Edit Schema...". Define the character set to the "Collation"-field. (MySQL Workbench 5.2.35)
在“模型概述”中,在“物理模式”下,右键单击数据库并选择“编辑模式...”。将字符集定义为“排序规则”字段。(MySQL 工作台 5.2.35)
回答by demongolem
For further reading, another fix would be to change the display font. Go to Edit -> Preferences -> Appearance
. Change the Editor font. It could be that the default font does not display utf-8 correctly, but others do.
为了进一步阅读,另一个解决方法是更改显示字体。去Edit -> Preferences -> Appearance
。更改编辑器字体。可能是默认字体不能正确显示 utf-8,但其他字体可以。
Oh, and if you are having trouble changing your font you can try here
哦,如果您在更改字体时遇到问题,可以尝试这里
回答by hasyee
You have to set every fields utf8 or Table default at the alter table.
您必须在更改表中将每个字段设置为 utf8 或表默认值。