<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>http://wiki.eijux.com/index.php?action=history&amp;feed=atom&amp;title=MySQL_%E5%AD%97%E7%AC%A6%E9%9B%86%EF%BC%9A%E5%AD%97%E7%AC%A6%E9%9B%86%E9%85%8D%E7%BD%AE</id>
	<title>MySQL 字符集：字符集配置 - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.eijux.com/index.php?action=history&amp;feed=atom&amp;title=MySQL_%E5%AD%97%E7%AC%A6%E9%9B%86%EF%BC%9A%E5%AD%97%E7%AC%A6%E9%9B%86%E9%85%8D%E7%BD%AE"/>
	<link rel="alternate" type="text/html" href="http://wiki.eijux.com/index.php?title=MySQL_%E5%AD%97%E7%AC%A6%E9%9B%86%EF%BC%9A%E5%AD%97%E7%AC%A6%E9%9B%86%E9%85%8D%E7%BD%AE&amp;action=history"/>
	<updated>2026-05-15T15:06:05Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.38.2</generator>
	<entry>
		<id>http://wiki.eijux.com/index.php?title=MySQL_%E5%AD%97%E7%AC%A6%E9%9B%86%EF%BC%9A%E5%AD%97%E7%AC%A6%E9%9B%86%E9%85%8D%E7%BD%AE&amp;diff=6511&amp;oldid=prev</id>
		<title>2023年3月31日 (五) 15:04 Eijux</title>
		<link rel="alternate" type="text/html" href="http://wiki.eijux.com/index.php?title=MySQL_%E5%AD%97%E7%AC%A6%E9%9B%86%EF%BC%9A%E5%AD%97%E7%AC%A6%E9%9B%86%E9%85%8D%E7%BD%AE&amp;diff=6511&amp;oldid=prev"/>
		<updated>2023-03-31T15:04:56Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2023年3月31日 (五) 23:04的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;第1行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第1行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[category:&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;MySQL&lt;/del&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[category:&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;MySQL文档&lt;/ins&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;MySQL 服务器具有内置的默认字符集和排序规则。要更改这些默认值，请在启动服务器时使用“'''--character-set-server'''”和“--collation-server”选项。&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;MySQL 服务器具有内置的默认字符集和排序规则。要更改这些默认值，请在启动服务器时使用“'''--character-set-server'''”和“--collation-server”选项。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Eijux</name></author>
	</entry>
	<entry>
		<id>http://wiki.eijux.com/index.php?title=MySQL_%E5%AD%97%E7%AC%A6%E9%9B%86%EF%BC%9A%E5%AD%97%E7%AC%A6%E9%9B%86%E9%85%8D%E7%BD%AE&amp;diff=2216&amp;oldid=prev</id>
		<title>Eijux：​建立内容为“category:MySQL  MySQL 服务器具有内置的默认字符集和排序规则。要更改这些默认值，请在启动服务器时使用“'''--character-set-…”的新页面</title>
		<link rel="alternate" type="text/html" href="http://wiki.eijux.com/index.php?title=MySQL_%E5%AD%97%E7%AC%A6%E9%9B%86%EF%BC%9A%E5%AD%97%E7%AC%A6%E9%9B%86%E9%85%8D%E7%BD%AE&amp;diff=2216&amp;oldid=prev"/>
		<updated>2021-03-28T23:06:06Z</updated>

		<summary type="html">&lt;p&gt;建立内容为“&lt;a href=&quot;/%E5%88%86%E7%B1%BB:MySQL&quot; title=&quot;分类:MySQL&quot;&gt;category:MySQL&lt;/a&gt;  MySQL 服务器具有内置的默认字符集和排序规则。要更改这些默认值，请在启动服务器时使用“&amp;#039;&amp;#039;&amp;#039;--character-set-…”的新页面&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[category:MySQL]]&lt;br /&gt;
&lt;br /&gt;
MySQL 服务器具有内置的默认字符集和排序规则。要更改这些默认值，请在启动服务器时使用“'''--character-set-server'''”和“--collation-server”选项。&lt;br /&gt;
* 该排序规则必须是默认字符集的合法排序规则。&lt;br /&gt;
* 若要确定每个字符集可用的排序规则，请使用“SHOW COLLATION”语句或查询“INFORMATION_SCHEMA”的“COLLATIONS”表。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
如果您尝试使用未编译到二进制文件中的字符集，则可能会遇到以下问题：&lt;br /&gt;
* 如果您的程序使用错误的路径来确定字符集的存储位置(通常是 MySQL 安装目录下的“share/mysql/charsets”或“share/charsets”目录)，则可以在运行程序时使用“'''--character-sets-dir'''”选项来解决此问题。&lt;br /&gt;
*: 例如，要指定 MySQLClient 端程序要使用的目录，请在'''配置文件'''的“'''[client]'''”组中列出该目录。此处给出的示例分别显示了 Unix 或 Windows 的设置：&lt;br /&gt;
*: &amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
[client]&lt;br /&gt;
character-sets-dir=/usr/local/mysql/share/mysql/charsets&lt;br /&gt;
&lt;br /&gt;
[client]&lt;br /&gt;
character-sets-dir=&amp;quot;C:/Program Files/MySQL/MySQL Server 5.7/share/charsets&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* 如果字符集是无法动态加载的复杂字符集，则必须在支持该字符集的情况下重新编译程序。&lt;br /&gt;
* 如果字符集是动态字符集，但是您没有针对它的配置文件，则应该从新的 MySQL 发行版中安装字符集的配置文件。&lt;br /&gt;
* 如果您的字符集索引文件（“'''Index.xml'''”）不包含该字符集的名称，则程序将显示错误消息：&lt;br /&gt;
*: &amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
Character set 'charset_name' is not a compiled character set and is not&lt;br /&gt;
specified in the '/usr/share/mysql/charsets/Index.xml' file&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*: 要解决此问题，您应该获取一个新的索引文件或将任何缺少的字符集的名称手动添加到当前文件中。&lt;br /&gt;
* 可以强制 Client 端程序使用特定的字符集，如下所示：【通常没不必要】&lt;br /&gt;
*: &amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
[client]&lt;br /&gt;
default-character-set=charset_name&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* 当“character_set_system”与“character_set_server”或“character_set_client”不同时，如果您手动输入字符（作为数据库对象标识符，列值或两者），则这些字符可能在 Client 端输出中显示不正确，或者输出本身的格式不正确。在这种情况下，使用“'''--default-character-set=system_character_set'''”启动 mysqlClient 端（即，将 Client 端字符集设置为与系统字符集匹配）应该可以解决该问题。&lt;/div&gt;</summary>
		<author><name>Eijux</name></author>
	</entry>
</feed>