mysql 浏览器submit中文, shell乱码
w控制变量法。
初始
浏览器submit中文
成功执行
问题仍未解决
执行
SET character_set_database='latin1';
再执行
SET character_set_results='utf8';
问题解决,shell不再乱码
https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_character_set_database
System Variable | Name | 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.
System Variable | Name | character_set_results |
|
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.