gpt4 book ai didi

mysql - 我如何找出mysql中的默认服务器字符集?

转载 作者:可可西里 更新时间:2023-11-01 06:57:45 24 4
gpt4 key购买 nike

在 FreeBSD 8.2 上使用 MySQL。如何找出默认的服务器字符集?是否有一些我可以运行的命令或我可以检查的文件?

更新

实际上我想知道如何找到默认服务器字符集当前服务器字符集。

最佳答案

根据 Server Character Set and Collation 记录:

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 将其称为 latin1,除非您的 MySQL 副本已使用其他默认值进行编译。

手册接着说:

The current server character set and collation can be determined from the values of the character_set_server and collation_server system variables. These variables can be changed at runtime.

因此,要发现当前正在使用的服务器字符集:

SHOW VARIABLES LIKE 'character_set_server'

关于mysql - 我如何找出mysql中的默认服务器字符集?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12327399/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com