mysql 乱码 大家好我在用MYSQL图形用户界面查看数据的时候,看到的数据表都是乱码,不知道怎么处理,请大家指教。谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 设置字符集,最好是全部设成utf-8,楼主google一下mysql乱码,应该有很多解决方案 当时安装mysql时 是不是没设置 字符编码格式?如果没设置的话 你现在可以找到my.ini文件 打开后找到 设置编码的地方 将 ISO8859-1改成 utf-8 MySQL是ladin1啊,不是ISO8859-1。再说MySQL有图形界面么?你说的那个图形界面指的是什么? 我在页面上显示的是中文 但是我用第三方工具(Navicat Premium)查看数据就显示是乱码不知道怎么修改求救啊。 mysql在安装的时候有个位置提示要选择默认的字符编码类型,我第一次装是选择的是utf-8,但是使用的时候还是出乱码,后来卸载重新装,这次选择的是gbk,ok了,没出现乱码了 你先写这个个servletpackage com.cstp.servlet;import java.io.IOException;import javax.servlet.Filter;import javax.servlet.FilterChain;import javax.servlet.FilterConfig;import javax.servlet.ServletException;import javax.servlet.ServletRequest;import javax.servlet.ServletResponse;public class SetCharacterEncodingFilter implements Filter { protected String encoding = null; protected FilterConfig filterConfig = null; protected boolean ignore = true; public void init(FilterConfig filterConfig) throws ServletException { this.filterConfig=filterConfig; this.encoding=filterConfig.getInitParameter("encoding"); String value=filterConfig.getInitParameter("ignore"); if(value==null) this.ignore=true; else if(value.equalsIgnoreCase("true")) this.ignore=true; else this.ignore=false; } public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { // TODO 自动生成方法存根 if (ignore || (request.getCharacterEncoding() == null)) { String encoding = selectEncoding(request); if (encoding != null) request.setCharacterEncoding(encoding); } chain.doFilter(request, response);}public void destroy() { // TODO 自动生成方法存根 this.encoding = null; this.filterConfig = null;}protected String selectEncoding(ServletRequest request) { return (this.encoding);}} 然后在XML里部署一下再试试看 hibernate-4.1.7+struts2问题(求解) Hibenate many-to-one 甄选条件 struts2验证框架中如何判断等值 求教一个学生管理系统的数据库设计 请教 求解logforJ google Guice 安装 how ? 请各位多提建议?? 如何使用包? ##########要用JAVA做一个大型电子商务网站,并且是用EJB,我该学习些什么东西呀? 360安全卫士7.1借口兼容问题诱使用户强行卸载金山网盾,金山安全认为,360安全卫士的这种卸载行为是赤裸裸的病毒行为 java中过滤重复
如果没设置的话 你现在可以找到my.ini文件 打开后找到 设置编码的地方 将 ISO8859-1改成 utf-8
不知道怎么修改
求救啊。
package com.cstp.servlet;
import java.io.IOException;import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;public class SetCharacterEncodingFilter implements Filter {
protected String encoding = null;
protected FilterConfig filterConfig = null;
protected boolean ignore = true; public void init(FilterConfig filterConfig) throws ServletException {
this.filterConfig=filterConfig;
this.encoding=filterConfig.getInitParameter("encoding");
String value=filterConfig.getInitParameter("ignore");
if(value==null)
this.ignore=true;
else if(value.equalsIgnoreCase("true"))
this.ignore=true;
else
this.ignore=false;
} public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
// TODO 自动生成方法存根
if (ignore || (request.getCharacterEncoding() == null)) {
String encoding = selectEncoding(request);
if (encoding != null)
request.setCharacterEncoding(encoding);
}
chain.doFilter(request, response);
}public void destroy() {
// TODO 自动生成方法存根
this.encoding = null;
this.filterConfig = null;
}protected String selectEncoding(ServletRequest request) {
return (this.encoding);
}
}
然后在XML里部署一下再试试看