shell mysql中文乱码_mysql 浏览器submit中文, shell乱码

w控制变量法。

初始

c5f1cc515b5fb8a3d573f700ee87f40c.png

浏览器submit中文

936b9d7cabe0baa1221a4af42ac14188.png

成功执行

5189fb102fc7ebb03f1a8331b942cdce.png

问题仍未解决

执行

SET character_set_database='latin1';

再执行

SET character_set_results='utf8';

问题解决,shell不再乱码

88c51bd3a486afb860da2d6e8400cf27.png

https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_character_set_database

Variable Scope

Global, Session

Dynamic Variable

Yes

Footnote

This option is dynamic, but only the server should set this information. You should not set the value of this variable manually.

Permitted Values

Type

string

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.

The global character_set_database and collation_database system variables are deprecated as of MySQL 5.7.6 and will be removed in a future version of MySQL.

Assigning a value to the session character_set_database and collation_database system variables is deprecated as of MySQL 5.7.6 and assignments produce a warning. The session variables will become read only in a future version of MySQL and assignments will produce an error. It will remain possible to access the session variables to determine the database character set and collation for the default database.

Variable Scope

Global, Session

Dynamic Variable

Yes

Permitted Values

Type

string

The character set used for returning query results such as result sets or error messages to the client.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值