如何在mysql中找到默认服务器字符集? [英] How do I find out the default server character set in mysql?
问题描述
在FreeBSD 8.2上使用MySQL。如何找到默认的服务器字符集?是否有一些命令我可以运行或文件我可以检查?
Using MySQL on FreeBSD 8.2. How do I find out the default server character set? Is there some command I can run or file I can check?
UPDATE
实际上,我想知道如何查找默认服务器字符集和 服务器字符集。
Actually I want to know how to find both the default server character set and the current server character set.
推荐答案
最初,服务器字符集和排序规则取决于您使用的选项您可以启动
mysqld
。您可以使用- character- set-server
。与此一起,您可以添加- collation-server
。如果您未指定字符集,则与说明- character-set-server = latin1
。
Initially, the server character set and collation depend on the options that you use when you start
mysqld
. You can use--character-set-server
for the character set. Along with it, you can add--collation-server
for the collation. If you don't specify a character set, that is the same as saying--character-set-server=latin1
.
因此,默认的服务器字符集是Windows-1252,除非您的MySQL副本已编译为其他默认值,否则MySQL会调用 latin1
。
The default server character set is therefore Windows-1252, which MySQL calls latin1
, unless your copy of MySQL has been compiled with some other default.
该手册继续说:
当前服务器字符集和排序规则可以从
character_set_server
和collation_server
系统变量。这些变量可以在运行时更改。
The current server character set and collation can be determined from the values of the
character_set_server
andcollation_server
system variables. These variables can be changed at runtime.
因此,要发现当前使用的服务器字符集:
Therefore, to discover the server character set currently in use:
SHOW VARIABLES LIKE 'character_set_server'
这篇关于如何在mysql中找到默认服务器字符集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!