使用 utf8mb4 代替 utf8
This commit is contained in:
parent
7d5f9e8f37
commit
ba8d777313
18
.env
18
.env
|
@ -1 +1,17 @@
|
||||||
APP_DEBUG = true
[APP]
DEFAULT_TIMEZONE = Asia/Shanghai
[DATABASE]
TYPE = mysql
HOSTNAME = 127.0.0.1
DATABASE = test
USERNAME = username
PASSWORD = password
HOSTPORT = 3306
CHARSET = utf8
DEBUG = true
[LANG]
default_lang = zh-cn
|
APP_DEBUG = true
|
||||||
|
|
||||||
|
[APP]
|
||||||
|
DEFAULT_TIMEZONE = Asia/Shanghai
|
||||||
|
|
||||||
|
[DATABASE]
|
||||||
|
TYPE = mysql
|
||||||
|
HOSTNAME = 127.0.0.1
|
||||||
|
DATABASE = test
|
||||||
|
USERNAME = username
|
||||||
|
PASSWORD = password
|
||||||
|
HOSTPORT = 3306
|
||||||
|
CHARSET = utf8mb4
|
||||||
|
DEBUG = true
|
||||||
|
|
||||||
|
[LANG]
|
||||||
|
default_lang = zh-cn
|
|
@ -83,13 +83,13 @@ class Install extends BaseController
|
||||||
return json(['code'=>0,'msg'=>'数据库链接失败:'.$error]);die;
|
return json(['code'=>0,'msg'=>'数据库链接失败:'.$error]);die;
|
||||||
}
|
}
|
||||||
// 设置字符集
|
// 设置字符集
|
||||||
$link->query("SET NAMES 'utf8'");
|
$link->query("SET NAMES 'utf8mb4'");
|
||||||
if($link->server_info < 5.0){
|
if($link->server_info < 5.0){
|
||||||
return json(['code'=>0,'msg'=>'请将您的mysql升级到5.0以上']);die;
|
return json(['code'=>0,'msg'=>'请将您的mysql升级到5.0以上']);die;
|
||||||
}
|
}
|
||||||
// 创建数据库并选中
|
// 创建数据库并选中
|
||||||
if(!$link->select_db($data['DB_NAME'])){
|
if(!$link->select_db($data['DB_NAME'])){
|
||||||
$create_sql='CREATE DATABASE IF NOT EXISTS '.$data['DB_NAME'].' DEFAULT CHARACTER SET utf8;';
|
$create_sql='CREATE DATABASE IF NOT EXISTS '.$data['DB_NAME'].' DEFAULT CHARACTER SET utf8mb4;';
|
||||||
if(!$link->query($create_sql)){
|
if(!$link->query($create_sql)){
|
||||||
return json(['code'=>0,'msg'=>'数据库连接失败']);die;
|
return json(['code'=>0,'msg'=>'数据库连接失败']);die;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ CREATE TABLE `vae_admin` (
|
||||||
`groups` varchar(255) NOT NULL DEFAULT '' COMMENT '权限组,隔开',
|
`groups` varchar(255) NOT NULL DEFAULT '' COMMENT '权限组,隔开',
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
UNIQUE KEY `username` (`id`,`username`) USING BTREE
|
UNIQUE KEY `username` (`id`,`username`) USING BTREE
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='管理员';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='管理员';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of vae_admin
|
-- Records of vae_admin
|
||||||
|
@ -49,13 +49,13 @@ CREATE TABLE `vae_admin_group` (
|
||||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`title` varchar(255) NOT NULL DEFAULT '',
|
`title` varchar(255) NOT NULL DEFAULT '',
|
||||||
`status` int(1) NOT NULL DEFAULT '1',
|
`status` int(1) NOT NULL DEFAULT '1',
|
||||||
`rules` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '用户组拥有的规则id, 多个规则","隔开',
|
`rules` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '用户组拥有的规则id, 多个规则","隔开',
|
||||||
`desc` text COMMENT '备注',
|
`desc` text COMMENT '备注',
|
||||||
`create_time` int(11) NOT NULL DEFAULT '0',
|
`create_time` int(11) NOT NULL DEFAULT '0',
|
||||||
`update_time` int(11) NOT NULL DEFAULT '0',
|
`update_time` int(11) NOT NULL DEFAULT '0',
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
UNIQUE KEY `id` (`id`) USING BTREE
|
UNIQUE KEY `id` (`id`) USING BTREE
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='权限分组';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='权限分组';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of vae_admin_group
|
-- Records of vae_admin_group
|
||||||
|
@ -68,7 +68,7 @@ DROP TABLE IF EXISTS `vae_admin_rule`;
|
||||||
CREATE TABLE `vae_admin_rule` (
|
CREATE TABLE `vae_admin_rule` (
|
||||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`pid` int(11) unsigned NOT NULL DEFAULT '0',
|
`pid` int(11) unsigned NOT NULL DEFAULT '0',
|
||||||
`src` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '规则',
|
`src` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '规则',
|
||||||
`title` varchar(255) NOT NULL DEFAULT '',
|
`title` varchar(255) NOT NULL DEFAULT '',
|
||||||
`is_menu` int(1) NOT NULL DEFAULT '1' COMMENT '1是菜单2不是',
|
`is_menu` int(1) NOT NULL DEFAULT '1' COMMENT '1是菜单2不是',
|
||||||
`font_family` varchar(50) DEFAULT '' COMMENT '图标来源',
|
`font_family` varchar(50) DEFAULT '' COMMENT '图标来源',
|
||||||
|
@ -78,7 +78,7 @@ CREATE TABLE `vae_admin_rule` (
|
||||||
`update_time` int(11) NOT NULL COMMENT '0',
|
`update_time` int(11) NOT NULL COMMENT '0',
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
KEY `name` (`src`) USING BTREE
|
KEY `name` (`src`) USING BTREE
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=55 DEFAULT CHARSET=utf8 COMMENT='权限节点';
|
) ENGINE=InnoDB AUTO_INCREMENT=55 DEFAULT CHARSET=utf8mb4 COMMENT='权限节点';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of vae_admin_rule
|
-- Records of vae_admin_rule
|
||||||
|
@ -143,7 +143,7 @@ DROP TABLE IF EXISTS `vae_cate`;
|
||||||
CREATE TABLE `vae_cate` (
|
CREATE TABLE `vae_cate` (
|
||||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`title` varchar(50) NOT NULL,
|
`title` varchar(50) NOT NULL,
|
||||||
`icon` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
|
`icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
|
||||||
`pid` int(11) NOT NULL DEFAULT '0',
|
`pid` int(11) NOT NULL DEFAULT '0',
|
||||||
`status` int(1) NOT NULL DEFAULT '1' COMMENT '1正常0下架',
|
`status` int(1) NOT NULL DEFAULT '1' COMMENT '1正常0下架',
|
||||||
`sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序,值越大越靠前',
|
`sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序,值越大越靠前',
|
||||||
|
@ -151,7 +151,7 @@ CREATE TABLE `vae_cate` (
|
||||||
`create_time` int(11) NOT NULL DEFAULT '0',
|
`create_time` int(11) NOT NULL DEFAULT '0',
|
||||||
`update_time` int(11) NOT NULL DEFAULT '0',
|
`update_time` int(11) NOT NULL DEFAULT '0',
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='分类';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='分类';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of vae_cate
|
-- Records of vae_cate
|
||||||
|
@ -163,11 +163,11 @@ CREATE TABLE `vae_cate` (
|
||||||
DROP TABLE IF EXISTS `vae_cate_group`;
|
DROP TABLE IF EXISTS `vae_cate_group`;
|
||||||
CREATE TABLE `vae_cate_group` (
|
CREATE TABLE `vae_cate_group` (
|
||||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
|
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
|
||||||
`key` varchar(50) NOT NULL,
|
`key` varchar(50) NOT NULL,
|
||||||
`desc` varchar(255) DEFAULT NULL,
|
`desc` varchar(255) DEFAULT NULL,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='分类分组';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='分类分组';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of vae_cate_group
|
-- Records of vae_cate_group
|
||||||
|
@ -179,9 +179,9 @@ CREATE TABLE `vae_cate_group` (
|
||||||
DROP TABLE IF EXISTS `vae_content`;
|
DROP TABLE IF EXISTS `vae_content`;
|
||||||
CREATE TABLE `vae_content` (
|
CREATE TABLE `vae_content` (
|
||||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`img` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '图片,多图用,隔开',
|
`img` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '图片,多图用,隔开',
|
||||||
`status` int(1) NOT NULL DEFAULT '1' COMMENT '1正常0下架',
|
`status` int(1) NOT NULL DEFAULT '1' COMMENT '1正常0下架',
|
||||||
`title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
|
`title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
|
||||||
`desc` varchar(500) DEFAULT NULL COMMENT '概要',
|
`desc` varchar(500) DEFAULT NULL COMMENT '概要',
|
||||||
`content` text COMMENT '详情',
|
`content` text COMMENT '详情',
|
||||||
`sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序,值越大越靠前',
|
`sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序,值越大越靠前',
|
||||||
|
@ -190,7 +190,7 @@ CREATE TABLE `vae_content` (
|
||||||
`create_time` int(11) NOT NULL DEFAULT '0',
|
`create_time` int(11) NOT NULL DEFAULT '0',
|
||||||
`update_time` int(11) NOT NULL DEFAULT '0',
|
`update_time` int(11) NOT NULL DEFAULT '0',
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='内容';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='内容';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of vae_content
|
-- Records of vae_content
|
||||||
|
@ -202,12 +202,12 @@ CREATE TABLE `vae_content` (
|
||||||
DROP TABLE IF EXISTS `vae_content_group`;
|
DROP TABLE IF EXISTS `vae_content_group`;
|
||||||
CREATE TABLE `vae_content_group` (
|
CREATE TABLE `vae_content_group` (
|
||||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
|
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
|
||||||
`key` varchar(50) NOT NULL,
|
`key` varchar(50) NOT NULL,
|
||||||
`cate_group_id` int(11) NOT NULL DEFAULT '0' COMMENT '分类组id',
|
`cate_group_id` int(11) NOT NULL DEFAULT '0' COMMENT '分类组id',
|
||||||
`desc` varchar(255) DEFAULT NULL,
|
`desc` varchar(255) DEFAULT NULL,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='内容分组';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='内容分组';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of vae_content_group
|
-- Records of vae_content_group
|
||||||
|
@ -221,14 +221,14 @@ CREATE TABLE `vae_nav` (
|
||||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`title` varchar(50) NOT NULL,
|
`title` varchar(50) NOT NULL,
|
||||||
`icon` varchar(255) NOT NULL,
|
`icon` varchar(255) NOT NULL,
|
||||||
`src` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
|
`src` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
|
||||||
`status` int(1) NOT NULL DEFAULT '1' COMMENT '1正常0下架',
|
`status` int(1) NOT NULL DEFAULT '1' COMMENT '1正常0下架',
|
||||||
`sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序,值越大越靠前',
|
`sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序,值越大越靠前',
|
||||||
`nav_group_id` int(11) NOT NULL DEFAULT '0',
|
`nav_group_id` int(11) NOT NULL DEFAULT '0',
|
||||||
`create_time` int(11) NOT NULL DEFAULT '0',
|
`create_time` int(11) NOT NULL DEFAULT '0',
|
||||||
`update_time` int(11) NOT NULL DEFAULT '0',
|
`update_time` int(11) NOT NULL DEFAULT '0',
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='导航';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='导航';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of vae_nav
|
-- Records of vae_nav
|
||||||
|
@ -240,11 +240,11 @@ CREATE TABLE `vae_nav` (
|
||||||
DROP TABLE IF EXISTS `vae_nav_group`;
|
DROP TABLE IF EXISTS `vae_nav_group`;
|
||||||
CREATE TABLE `vae_nav_group` (
|
CREATE TABLE `vae_nav_group` (
|
||||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
|
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
|
||||||
`key` varchar(50) NOT NULL,
|
`key` varchar(50) NOT NULL,
|
||||||
`desc` varchar(255) DEFAULT NULL,
|
`desc` varchar(255) DEFAULT NULL,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='导航分组';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='导航分组';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of vae_nav_group
|
-- Records of vae_nav_group
|
||||||
|
@ -263,7 +263,7 @@ CREATE TABLE `vae_route` (
|
||||||
`create_time` int(11) NOT NULL DEFAULT '0',
|
`create_time` int(11) NOT NULL DEFAULT '0',
|
||||||
`update_time` int(11) NOT NULL DEFAULT '0',
|
`update_time` int(11) NOT NULL DEFAULT '0',
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='路由设置';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='路由设置';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of vae_route
|
-- Records of vae_route
|
||||||
|
@ -283,7 +283,7 @@ CREATE TABLE `vae_slide` (
|
||||||
`create_time` int(11) NOT NULL DEFAULT '0',
|
`create_time` int(11) NOT NULL DEFAULT '0',
|
||||||
`update_time` int(11) NOT NULL DEFAULT '0',
|
`update_time` int(11) NOT NULL DEFAULT '0',
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='轮播';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='轮播';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of vae_slide
|
-- Records of vae_slide
|
||||||
|
@ -295,11 +295,11 @@ CREATE TABLE `vae_slide` (
|
||||||
DROP TABLE IF EXISTS `vae_slide_group`;
|
DROP TABLE IF EXISTS `vae_slide_group`;
|
||||||
CREATE TABLE `vae_slide_group` (
|
CREATE TABLE `vae_slide_group` (
|
||||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
|
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
|
||||||
`key` varchar(50) NOT NULL,
|
`key` varchar(50) NOT NULL,
|
||||||
`desc` varchar(255) DEFAULT NULL,
|
`desc` varchar(255) DEFAULT NULL,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='轮播分组';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='轮播分组';
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of vae_slide_group
|
-- Records of vae_slide_group
|
||||||
|
|
Loading…
Reference in New Issue