mysql字符集设置
2017-05-11 11:10
169 查看
mysql> show variables like 'char%' ;
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8mb4 |
| character_set_connection | utf8mb4 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8mb4 |
| character_set_server | utf8mb4 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
mysql> show variables like 'col%' ;
+----------------------+--------------------+
| Variable_name | Value |
+----------------------+--------------------+
| collation_connection | utf8mb4_general_ci |
| collation_database | utf8mb4_general_ci |
| collation_server | utf8mb4_general_ci |
[mysqld]
character_set_server = utf8mb4
#collation_server=utf8mb4_unicode_ci
character-set-client-handshake = FALSE
init_connect='SET NAMES utf8mb4'
[client]
default-character-set=utf8mb4
[mysql]
default-character-set=utf8mb4
设置字符集:
character_set_client :
1, The character set for statements that arrive from the client.
2, The session value of this variable is set using the character set requested by the client when the client connects to the server. (Many clients support a --default-character-set option to enable this character set to
be specified explicitly )
3, [mysql] default-character-set=utf8mb4
4,What character set is the statement in when it leaves the client?
The server takes the character_set_client system variable to be the character set in which
statements are sent by the client.
character_set_connection :
collation_connection:
1,It converts statements sent by the client from character_set_client
to character_set_connection
2,What character set should the server translate a statement to after receiving it?
3,SET NAMES 'charset_name'
4,[mysql] default-character-set = utf8mb4
character_set_database :
collation_database:
1,The character set used by the default database. The server sets this variable whenever the
default database changes. If there is no default database, the variable has the same value as
character_set_server .
2,The character set and collation for the default database can be determined from the values of the
character_set_database and
collation_database system variables。The server sets these
variables whenever the default database changes. If there is no default database, the variables have the same value as the corresponding server-level system variables,
character_set_server and
collation_server
character_set_filesystem :
1,The file system character set. This variable is used to interpret string literals that refer to file
names, such as in the LOAD DATA INFILE and
SELECT ... INTO OUTFILE statements and
the LOAD_FILE() function.
Such file names are converted from character_set_client to
character_set_filesystem before the file opening attempt occurs. The default value is binary,
which means that no conversion occurs. For systems on which multibyte file names are permitted, a different value may be more appropriate. For example, if the system represents file names using UTF-8, set
character_set_filesystem to 'utf8'.
character_set_results:
1,The character set used for returning query results such as result sets or error messages to the client.
2,If character_set_results is set to NULL, no conversion is performed and the server returns metadata using its original character set (the set indicated by character_set_system).
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8mb4 |
| character_set_connection | utf8mb4 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8mb4 |
| character_set_server | utf8mb4 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
mysql> show variables like 'col%' ;
+----------------------+--------------------+
| Variable_name | Value |
+----------------------+--------------------+
| collation_connection | utf8mb4_general_ci |
| collation_database | utf8mb4_general_ci |
| collation_server | utf8mb4_general_ci |
[mysqld]
character_set_server = utf8mb4
#collation_server=utf8mb4_unicode_ci
character-set-client-handshake = FALSE
init_connect='SET NAMES utf8mb4'
[client]
default-character-set=utf8mb4
[mysql]
default-character-set=utf8mb4
设置字符集:
character_set_client :
1, The character set for statements that arrive from the client.
2, The session value of this variable is set using the character set requested by the client when the client connects to the server. (Many clients support a --default-character-set option to enable this character set to
be specified explicitly )
3, [mysql] default-character-set=utf8mb4
4,What character set is the statement in when it leaves the client?
The server takes the character_set_client system variable to be the character set in which
statements are sent by the client.
character_set_connection :
collation_connection:
1,It converts statements sent by the client from character_set_client
to character_set_connection
2,What character set should the server translate a statement to after receiving it?
3,SET NAMES 'charset_name'
4,[mysql] default-character-set = utf8mb4
character_set_database :
collation_database:
1,The character set used by the default database. The server sets this variable whenever the
default database changes. If there is no default database, the variable has the same value as
character_set_server .
2,The character set and collation for the default database can be determined from the values of the
character_set_database and
collation_database system variables。The server sets these
variables whenever the default database changes. If there is no default database, the variables have the same value as the corresponding server-level system variables,
character_set_server and
collation_server
character_set_filesystem :
1,The file system character set. This variable is used to interpret string literals that refer to file
names, such as in the LOAD DATA INFILE and
SELECT ... INTO OUTFILE statements and
the LOAD_FILE() function.
Such file names are converted from character_set_client to
character_set_filesystem before the file opening attempt occurs. The default value is binary,
which means that no conversion occurs. For systems on which multibyte file names are permitted, a different value may be more appropriate. For example, if the system represents file names using UTF-8, set
character_set_filesystem to 'utf8'.
character_set_results:
1,The character set used for returning query results such as result sets or error messages to the client.
2,If character_set_results is set to NULL, no conversion is performed and the server returns metadata using its original character set (the set indicated by character_set_system).
相关文章推荐
- 用命令行设置mysql字符集(转载)
- MySQL免安装版中文字符集设置
- Mysql 默认字符集设置方法(免安装版)
- MYSQL 设置字符集
- 设置Mysql字符集
- MYSQL 字符集的设置(命令行模式设置character_set*)
- MySQL字符集的设置
- mysql中的乱码总结之mysql5中四个设置字符集的系统变量
- mysql中的乱码总结之mysql5中四个设置字符集的系统变量
- mysql中的乱码总结之mysql5中四个设置字符集的系统变量
- [转]深入Mysql字符集设置
- 深入Mysql字符集设置
- [转]深入Mysql字符集设置
- MYSQL 字符集的设置(命令行模式设置character_set*)
- 深入Mysql字符集设置
- mysql 字符集的设置
- Mysql(免安装版)设置默认字符集
- Mysql字符集设置研究
- 深入Mysql字符集设置(1)
- Mysql 字符集 设置