0

在 MySQL 中,如何更改 character_set_client 等变量?

mysql> 显示像 'character_set%' 这样的变量;
-------------------------+--------
character_set_client | 拉丁语1

获得

character_set_client | utf8
4

1 回答 1

0

启动 MySQL 客户端时,您必须指定--default-character-set=charset_name

手册

       Use charset_name as the default character set for the client and
       connection.

       A common issue that can occur when the operating system uses utf8
       or another multi-byte character set is that output from the mysql
       client is formatted incorrectly, due to the fact that the MySQL
       client uses the latin1 character set by default. You can usually
       fix such issues by using this option to force the client to use the
       system character set instead.

例如:

$>mysql -uUser -pPassword --default-character-set=utf8

有关如何通过连接字符串设置它的示例,请参见此处

于 2012-09-04T09:33:54.940 回答