How to find out the default server character set in mysql?

Using MySQL in FreeBSD 8.2. How to find out the default server character set? Is there any command that I can run, or a file that I can verify?

UPDATE

Actually, I want to know how to find the default character set and the current server character set.

+4
source share
2 answers

As described in Typing and sorting server characters :

Initially, the character set and server sorting depends on the parameters that you use when starting mysqld . You can use --character-set-server for a character set. Along with this, you can add --collation-server for sorting. If you do not specify a character set, it will be the same as saying --character-set-server=latin1 .

Thus, the default server character set is Windows-1252, which MySQL calls latin1 unless your copy of MySQL has been compiled with some other default value.

The manual further states:

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

Therefore, to detect the server character set that is currently being used:

 SHOW VARIABLES LIKE 'character_set_server' 
+7
source

According to the documentation . That's what you need:

 SHOW VARIABLES LIKE 'character_set%'; SHOW VARIABLES LIKE 'collation%'; 

Or even better:

 SHOW VARIABLES LIKE 'c%'; 
+3
source

Source: https://habr.com/ru/post/1433088/


All Articles