[client] port=3306 [mysql] default-character-set=gbk # SERVER SECTION # ---------------------------------------------------------------------- # # The following options will be read by the MySQL Server. Make sure that # you have installed the server correctly (see above) so it reads this # file. # [mysqld] # The TCP/IP Port the MySQL Server will listen on port=3306 #Path to installation directory. All paths are usually resolved relative to this. basedir="D:/Program Files/MySQL/MySQL Server 5.1/" #Path to the database root datadir="D:/Program Files/MySQL/MySQL Server 5.1/Application Data/Data/" # The default character set that will be used when a new schema or table is # created and no character set is defined default-character-set=gbk # The default storage engine that will be used when create new tables when default-storage-engine=INNODB 使用MySQL Workbench设计数据库 ,数据库和表均使用默认的字符集 在Servlet中转换字符编码 String name = request.getParameter("name"); name = new String(name.getBytes("ISO-8859-1")); 设置JSP页面字符集为GBK <%@ page language="java" pageEncoding="GBK"%>