Mysql中文乱码问题完美解决方案
drop database`netctoss_demo` ;
CREATE DATABASE `netctoss_demo`
CHARACTER SET 'utf8'
COLLATE 'utf8_general_ci';
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50621
Source Host : localhost:3306
Source Database : netctoss_demo
Target Server Type : MYSQL
Target Server Version : 50621
File Encoding : 65001
Date: 2016-02-18 21:32:28
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `account`
-- ----------------------------
DROP TABLE IF EXISTS `account`;
CREATE TABLE `account` (
`ACCOUNT_ID` decimal(9,0) NOT NULL,
`RECOMMENDER_ID` decimal(9,0) DEFAULT NULL,
`LOGIN_NAME` varchar(30) NOT NULL,
`LOGIN_PASSWD` varchar(30) NOT NULL,
`STATUS` char(1) DEFAULT NULL,
`CREATE_DATE` datetime DEFAULT NULL,
`PAUSE_DATE` datetime DEFAULT NULL,
`CLOSE_DATE` datetime DEFAULT NULL,
`REAL_NAME` varchar(20) NOT NULL,
`IDCARD_NO` char(18) NOT NULL,
`BIRTHDATE` datetime DEFAULT NULL,
`GENDER` char(1) DEFAULT NULL,
`OCCUPATION` varchar(50) DEFAULT NULL,
`TELEPHONE` varchar(15) NOT NULL,
`EMAIL` varchar(50) DEFAULT NULL,
`MAILADDRESS` varchar(200) DEFAULT NULL,
`ZIPCODE` char(6) DEFAULT NULL,
`QQ` varchar(15) DEFAULT NULL,
`LAST_LOGIN_TIME` datetime DEFAULT NULL,
`LAST_LOGIN_IP` varchar(15) DEFAULT NULL,
PRIMARY KEY (`ACCOUNT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of account
-- ----------------------------
INSERT INTO `account` VALUES ('1005', null, 'taiji001', '256528', '1', '2008-03-15 00:00:00', null, null, 'zhangsanfeng', '', '1943-02-25 00:00:00', null, null, '13669351234', null, null, null, null, null, null);
INSERT INTO `account` VALUES ('1010', null, 'xl18z60', '190613', '1', '2009-01-10 00:00:00', null, null, 'guojing', '', '1969-03-19 00:00:00', null, null, '13338924567', null, null, null, null, null, null);
INSERT INTO `account` VALUES ('1011', '1010', 'dgbf70', '270429', '1', '2009-03-01 00:00:00', null, null, 'huangrong', '', '1971-08-27 00:00:00', null, null, '13637811357', null, null, null, null, null, null);
INSERT INTO `account` VALUES ('1015', '1005', 'mjjzh64', '041115', '1', '2010-03-12 00:00:00', null, null, 'zhangwuji', '', '1989-06-04 00:00:00', null, null, '13572952468', null, null, null, null, null, null);
INSERT INTO `account` VALUES ('1018', '1011', 'jmdxj00', '010322', '1', '2011-01-01 00:00:00', null, null, 'guofurong', '', '1996-01-01 00:00:00', null, null, '18617832562', null, null, null, null, null, null);
INSERT INTO `account` VALUES ('1019', '1011', 'ljxj90', '310346', '1', '2012-02-01 00:00:00', null, null, 'luwushuang', '', '1993-07-31 00:00:00', null, null, '13186454984', null, null, null, null, null, null);
INSERT INTO `account` VALUES ('1020', null, 'kxhxd20', '012115', '1', '2012-02-20 00:00:00', null, null, 'weixiaobao', '', '2000-10-01 00:00:00', null, null, '13953410078', null, null, null, null, null, null);
INSERT INTO `account` VALUES ('1021', null, 'kxhxd21', '012116', '1', '2012-02-20 00:00:00', null, null, 'zhangsan', '', '2000-10-02 00:00:00', null, null, '13953410079', null, null, null, null, null, null);
INSERT INTO `account` VALUES ('1022', null, 'kxhxd22', '012117', '1', '2012-02-20 00:00:00', null, null, 'lisi', '', '2000-10-03 00:00:00', null, null, '13953410080', null, null, null, null, null, null);
INSERT INTO `account` VALUES ('1023', null, 'kxhxd23', '012118', '1', '2012-02-20 00:00:00', null, null, 'wangwu', '', '2000-10-04 00:00:00', null, null, '13953410081', null, null, null, null, null, null);
INSERT INTO `account` VALUES ('1024', null, 'kxhxd24', '012119', '1', '2012-02-20 00:00:00', null, null, 'zhouliu', '', '2000-10-05 00:00:00', null, null, '13953410082', null, null, null, null, null, null);
INSERT INTO `account` VALUES ('1025', null, 'kxhxd25', '012120', '1', '2012-02-20 00:00:00', null, null, 'maqi', '', '2000-10-06 00:00:00', null, null, '13953410083', null, null, null, null, null, null);
-- ----------------------------
-- Table structure for `admin_info`
-- ----------------------------
DROP TABLE IF EXISTS `admin_info`;
CREATE TABLE `admin_info` (
`ADMIN_ID` decimal(8,0) NOT NULL,
`ADMIN_CODE` varchar(30) NOT NULL,
`PASSWORD` varchar(30) NOT NULL,
`NAME` varchar(30) NOT NULL,
`TELEPHONE` varchar(15) DEFAULT NULL,
`EMAIL` varchar(50) DEFAULT NULL,
`ENROLLDATE` datetime NOT NULL,
PRIMARY KEY (`ADMIN_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of admin_info
-- ----------------------------
INSERT INTO `admin_info` VALUES ('2000', 'admin', 'admin', 'ADMIN', '123456789', 'admin@tarena.com.cn', '2016-02-18 00:00:00');
INSERT INTO `admin_info` VALUES ('3000', 'zhangfei', 'admin', 'ZhangFei', '123456789', 'zhangfei@tarena.com.cn', '2016-02-18 00:00:00');
INSERT INTO `admin_info` VALUES ('4000', 'liubei', 'admin', 'LiuBei', '123456789', 'liubei@tarena.com.cn', '2016-02-18 00:00:00');
INSERT INTO `admin_info` VALUES ('5000', 'caocao', '123', 'CaoCao', '123456789', 'caocao@tarena.com.cn', '2016-02-18 00:00:00');
INSERT INTO `admin_info` VALUES ('6000', 'aaa', '123', 'AAA', '123456789', 'aaa@tarena.com.cn', '2016-02-18 00:00:00');
INSERT INTO `admin_info` VALUES ('7000', 'bbb', '123', 'BBB', '123456789', 'bbb@tarena.com.cn', '2016-02-18 00:00:00');
-- ----------------------------
-- Table structure for `admin_role`
-- ----------------------------
DROP TABLE IF EXISTS `admin_role`;
CREATE TABLE `admin_role` (
`ADMIN_ID` decimal(8,0) NOT NULL,
`ROLE_ID` decimal(4,0) NOT NULL,
PRIMARY KEY (`ADMIN_ID`,`ROLE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of admin_role
-- ----------------------------
INSERT INTO `admin_role` VALUES ('2000', '100');
INSERT INTO `admin_role` VALUES ('3000', '200');
INSERT INTO `admin_role` VALUES ('4000', '300');
INSERT INTO `admin_role` VALUES ('5000', '100');
INSERT INTO `admin_role` VALUES ('5000', '200');
INSERT INTO `admin_role` VALUES ('5000', '300');
-- ----------------------------
-- Table structure for `cost`
-- ----------------------------
DROP TABLE IF EXISTS `cost`;
CREATE TABLE `cost` (
`COST_ID` decimal(4,0) NOT NULL,
`NAME` varchar(50) NOT NULL,
`BASE_DURATION` decimal(11,0) DEFAULT NULL,
`BASE_COST` decimal(7,2) DEFAULT NULL,
`UNIT_COST` decimal(7,4) DEFAULT NULL,
`STATUS` char(1) DEFAULT NULL,
`DESCR` varchar(100) DEFAULT NULL,
`CREATIME` datetime DEFAULT NULL,
`STARTIME` datetime DEFAULT NULL,
`COST_TYPE` char(1) DEFAULT NULL,
PRIMARY KEY (`COST_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of cost
-- ----------------------------
INSERT INTO `cost` VALUES ('1', '5.9元套餐', '20', '5.90', '0.4000', '0', '5.9元20小时/月,超出部分0.4元/时', null, null, null);
INSERT INTO `cost` VALUES ('2', '6.9元套餐', '40', '6.90', '0.3000', '0', '6.9元40小时/月,超出部分0.3元/时', null, null, null);
INSERT INTO `cost` VALUES ('3', '8.5元套餐', '100', '8.50', '0.2000', '0', '8.5元100小时/月,超出部分0.2元/时', null, null, null);
INSERT INTO `cost` VALUES ('4', '10.5元套餐', '200', '10.50', '0.1000', '0', '10.5元200小时/月,超出部分0.1元/时', null, null, null);
INSERT INTO `cost` VALUES ('5', '计时收费', null, null, '0.5000', '0', '0.5元/时,不使用不收费', null, null, null);
INSERT INTO `cost` VALUES ('6', '包月', null, '20.00', null, '0', '每月20元,不限制使用时间', null, null, null);
INSERT INTO `cost` VALUES ('7', 'mm', '10', '5.00', null, '0', '', null, null, null);
INSERT INTO `cost` VALUES ('8', 'nn', '10', '7.00', null, '0', '', null, null, null);
INSERT INTO `cost` VALUES ('9', 'qq', '10', '4.00', null, '0', '', null, null, null);
-- ----------------------------
-- Table structure for `module_info`
-- ----------------------------
DROP TABLE IF EXISTS `module_info`;
CREATE TABLE `module_info` (
`MODULE_ID` decimal(4,0) NOT NULL,
`NAME` varchar(50) NOT NULL,
PRIMARY KEY (`MODULE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of module_info
-- ----------------------------
INSERT INTO `module_info` VALUES ('1', '角色管理');
INSERT INTO `module_info` VALUES ('2', '管理员');
INSERT INTO `module_info` VALUES ('3', '资费管理');
INSERT INTO `module_info` VALUES ('4', '账务账号');
INSERT INTO `module_info` VALUES ('5', '业务账号');
INSERT INTO `module_info` VALUES ('6', '账单管理');
INSERT INTO `module_info` VALUES ('7', '报表');
-- ----------------------------
-- Table structure for `role_info`
-- ----------------------------
DROP TABLE IF EXISTS `role_info`;
CREATE TABLE `role_info` (
`ROLE_ID` decimal(4,0) NOT NULL,
`NAME` varchar(50) NOT NULL,
PRIMARY KEY (`ROLE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of role_info
-- ----------------------------
INSERT INTO `role_info` VALUES ('100', '管理员');
INSERT INTO `role_info` VALUES ('200', '营业员');
INSERT INTO `role_info` VALUES ('300', '经理');
INSERT INTO `role_info` VALUES ('400', 'aaa');
INSERT INTO `role_info` VALUES ('500', 'bbb');
INSERT INTO `role_info` VALUES ('600', 'ccc');
-- ----------------------------
-- Table structure for `role_module`
-- ----------------------------
DROP TABLE IF EXISTS `role_module`;
CREATE TABLE `role_module` (
`ROLE_ID` decimal(4,0) NOT NULL,
`MODULE_ID` decimal(4,0) NOT NULL,
PRIMARY KEY (`ROLE_ID`,`MODULE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of role_module
-- ----------------------------
INSERT INTO `role_module` VALUES ('100', '1');
INSERT INTO `role_module` VALUES ('100', '2');
INSERT INTO `role_module` VALUES ('100', '4');
INSERT INTO `role_module` VALUES ('100', '5');
INSERT INTO `role_module` VALUES ('100', '6');
INSERT INTO `role_module` VALUES ('100', '7');
INSERT INTO `role_module` VALUES ('200', '3');
INSERT INTO `role_module` VALUES ('200', '4');
INSERT INTO `role_module` VALUES ('200', '5');
INSERT INTO `role_module` VALUES ('200', '6');
INSERT INTO `role_module` VALUES ('300', '7');
-- ----------------------------
-- Table structure for `service`
-- ----------------------------
DROP TABLE IF EXISTS `service`;
CREATE TABLE `service` (
`SERVICE_ID` decimal(10,0) NOT NULL,
`ACCOUNT_ID` decimal(9,0) NOT NULL,
`UNIX_HOST` varchar(15) NOT NULL,
`OS_USERNAME` varchar(8) NOT NULL,
`LOGIN_PASSWD` varchar(30) NOT NULL,
`STATUS` char(1) DEFAULT NULL,
`CREATE_DATE` datetime DEFAULT NULL,
`PAUSE_DATE` datetime DEFAULT NULL,
`CLOSE_DATE` datetime DEFAULT NULL,
`COST_ID` decimal(4,0) NOT NULL,
PRIMARY KEY (`SERVICE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of service
-- ----------------------------
INSERT INTO `service` VALUES ('2001', '1010', '192.168.0.26', 'guojing', 'guo1234', '0', '2016-02-18 00:00:00', null, null, '1');
INSERT INTO `service` VALUES ('2002', '1011', '192.168.0.26', 'huangr', 'huang234', '0', '2016-02-18 00:00:00', null, null, '1');
INSERT INTO `service` VALUES ('2003', '1011', '192.168.0.20', 'huangr', 'huang234', '0', '2016-02-18 00:00:00', null, null, '3');
INSERT INTO `service` VALUES ('2004', '1011', '192.168.0.23', 'huangr', 'huang234', '0', '2016-02-18 00:00:00', null, null, '6');
INSERT INTO `service` VALUES ('2005', '1019', '192.168.0.26', 'luwsh', 'luwu2345', '0', '2016-02-18 00:00:00', null, null, '4');
INSERT INTO `service` VALUES ('2006', '1019', '192.168.0.20', 'luwsh', 'luwu2345', '0', '2016-02-18 00:00:00', null, null, '5');
INSERT INTO `service` VALUES ('2007', '1020', '192.168.0.20', 'weixb', 'wei12345', '0', '2016-02-18 00:00:00', null, null, '6');
INSERT INTO `service` VALUES ('2008', '1010', '192.168.0.20', 'guojing', 'guo09876', '0', '2016-02-18 00:00:00', null, null, '6');
-- ----------------------------
-- Table structure for `service_update_bak`
-- ----------------------------
DROP TABLE IF EXISTS `service_update_bak`;
CREATE TABLE `service_update_bak` (
`ID` decimal(10,0) NOT NULL,
`SERVICE_ID` decimal(9,0) NOT NULL,
`COST_ID` decimal(4,0) NOT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of service_update_bak
-- ----------------------------