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

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.

character_set_results

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.

mysql 浏览器submit中文, shell乱码的更多相关文章

  1. html声明charset="utf-8"后,浏览器访问中文依旧乱码(绝对有效)

        1.情景展示 html文件已经声明字符集为UTF-8,但是浏览器访问依旧乱码. 标题和页面内容都是乱码,这是怎么回事? 2.原因分析  charset="UTF-8"是让浏 ...

  2. 笔记:PHP查询mysql数据后中文字符乱码

    新建表Clubs CREATE TABLE `Clubs` ( `id` ) NOT NULL AUTO_INCREMENT, `name` ) CHARACTER SET utf8 NOT NULL ...

  3. springmvc+mybatis+mysql 数据库插入中文是乱码

    java web项目,前台页面的表单数据,插入到数据库时,结果出现乱码"???"的问题,断断续续折腾了一天时间,废话不说,步骤如下: 一:在web.xml中配置:编码格式拦截器 & ...

  4. java使用c3p0连接mysql,写中文数据乱码的问题

    此文说的乱码,是指所有中文的字符都变成了?. 首先,网上普遍搜索到的解决方案都是告诉你要在数据库连接字符串里面增加编码的定义,完整的连接字符串如下: url="jdbc:mysql://12 ...

  5. servlet中中文正常显示,mysql数据库手动插入中文正常显示,servlet向mysql中插入中文显示乱码

    作者:http://5563447.blog.51cto.com/5553447/1422627 问题是:就是POST请求提交表单数据给servlet,通过JDBC插入Mysql,出现中文乱码. 解决 ...

  6. java向mysql中写入中文出现乱码

    乱码的原因有很多,我遇到的原因是url配置的问题,解决方案: 将: jdbc.url=jdbc:mysql://localhost:3306/XXXX?useUnicode=true&char ...

  7. android开发中 解决服务器端解析MySql数据时中文显示乱码的情况

    首先,还是确认自己MySql账户和密码 1.示例  账户:root   密码:123456   有三个字段   分别是_id  .username(插入有中文数据).password 1)首先我们知道 ...

  8. hibernate操作mysql插入修改中文出现乱码

    第一步:mysql的安装目录下配置文件my.ini里面的所有default-character-set改成default-character-set = utf8: 第二部:建立数据库时候字符集选项选

  9. 关于建立MySQL数据库,中文出现乱码问题

    MySQL的ini文件中的默认编码设置utf-8不用改 loose-default-character-set = utf-8 注意:需要改动部分 1.如图所示 建立schema时改变字符编码 改变为 ...

随机推荐

  1. cocos2d-x 之 CCProgressTimer

    --绕圆心转动的进度动画 local function SpriteProgressToRadial() local leftProgress = CCProgressTimer:create(CCS ...

  2. 用C语言(apue)实现 把时间戳转换为国标格式的字符串(2017-07-17 22:36:12)的函数

    /*******************************************************************************/ /** *** 函 数 名: cha ...

  3. 自定义控件VS用户控件

    自定义控件VS用户控件 2015-06-16 1 自定义控件与用户控件区别 WinForm中, 用户控件(User Control):继承自 UserControl,主要用于开发 Container ...

  4. Unix系统编程()进程和程序

    进程(process)是一个可执行程序(program)的实例. 程序是包含了一系列信息的文件,这些信息描述了如何在运行时创建一个进程,所包括的内容如下所示. 二进制格式标识:每个程序文件都包含用于描 ...

  5. [转]PHP 5.3.0以上推荐使用mysqlnd驱动

    我们一般的使用场景,比较少关注PHP版本的问题,而且市面上提供的PHP运行环境都还是5.2系列的. 原文:http://zhangxugg-163-com.iteye.com/blog/1894990 ...

  6. 记一次redis攻击

    服务器挖矿病毒的排查过程 事情起因:朋友的一台阿里云主机,登录特别卡,找我看看 这一看就感觉出问题了,机器特别卡,top看了一眼,cpu几乎是100%运行 但是奇怪的是用top命令完全看不出来哪个进程 ...

  7. FastDFS 双tracker负载均衡 及多组存储配置

    应用场景: 三台服务器分别做三组存储,并且需要两台tracker地址做主备关系,当一台down机后需要另外一台可以提供正常的访问连接 #注:此处不考虑存储数据安全性,如果需要保障数据不丢失,可以分别每 ...

  8. dp - HNU 13404 The Imp

    The Imp Problem's Link: http://acm.hnu.cn/online/?action=problem&type=show&id=13404&cour ...

  9. HBase学习系列

    转自:http://www.aboutyun.com/thread-8391-1-1.html 问题导读: 1.hbase是什么? 2.hbase原理是什么? 3.hbase使用中会遇到什么问题? 4 ...

  10. 关于Cocos2d-x中两个场景之间参数的传递

    两个场景之间,有的时候要进行参数传递,如果想通过实例化出一个场景,从而得到属性和方法是不对的想法 你有两个场景,第一场景是用户登录界面,第二场景则是你登录后的界面,你如何将用户登录的值传到第二个场景呢 ...