1. 使用navicat新建数据库tp6admin ![](https://img.kancloud.cn/b1/7a/b17a092e52b519e7c2ca28aed6066c38_654x381.png) 2. 在数据库配置文件.env中配置数据库连接 ``` [DATABASE] TYPE = mysql HOSTNAME = 127.0.0.1 DATABASE = tp6admin USERNAME = root PASSWORD = root HOSTPORT = 3306 CHARSET = utf8 DEBUG = true PREFIX = zq_ ``` 3. 插入数据的sql语句 ``` DROP TABLE IF EXISTS `zq_manage`; CREATE TABLE `zq_manage` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '用户ID', `username` varchar(20) NOT NULL COMMENT '用户名', `password` char(32) NOT NULL COMMENT '密码 md5(md5()+创建时间)', `mobile` char(15) DEFAULT NULL COMMENT '手机号', `avatar` varchar(255) DEFAULT NULL COMMENT '头像', `nickname` varchar(50) DEFAULT NULL COMMENT '昵称', `ctime` bigint(12) unsigned NOT NULL COMMENT '创建时间', `utime` bigint(12) unsigned NOT NULL COMMENT '更新时间', `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '1 = 正常 2 = 停用', `is_del` bigint(12) NOT NULL DEFAULT '0' COMMENT '是否删除,0代表未删除', PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='管理员表'; DROP TABLE IF EXISTS `zq_operation_log`; CREATE TABLE `zq_operation_log` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `manage_id` int(10) unsigned DEFAULT NULL COMMENT '管理员ID', `username` varchar(20) DEFAULT NULL, `controller` varchar(50) DEFAULT NULL COMMENT '操作的控制器名', `method` varchar(50) DEFAULT NULL COMMENT '操作方法名', `desc` varchar(255) DEFAULT NULL COMMENT '操作描述', `content` text COMMENT '操作数据序列号存储', `ip` char(50) DEFAULT NULL COMMENT '操作IP', `ctime` bigint(12) unsigned DEFAULT NULL COMMENT '操作时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='后台操作记录表'; ```