下载并导入MySQL示例数据库employees

一、下载employees数据库

https://github.com/datacharmer/test_db
test_db

二、MySQL官方参考手册

https://dev.mysql.com/doc/employee/en/employees-installation.html

三、具体步骤

3.1 下载test_db

在这里插入图片描述

3.2 在test_db-master中打开cmd(进入test_db-master目录)

在这里插入图片描述
或者直接在桌面打开cmd,使用 “cd + 目录 ",进入此目录。

3.3 run-install

执行employees.sql
mysql -uroot -p密码 -t < employees.sql

显示下面的"CREATING DATABASE STRUCTURE"、“storage engine: InnoDB”、"LOADING departments"等
在这里插入图片描述

3.4 验证employee数据

有两种方式:md5&sha
在这里插入图片描述

3.5 show databases\tables & select * from departments

在这里插入图片描述
employees为刚刚执行后导入的,information_schema、mysql、performance_schma、sys为mysql8.0安装时自带的4个数据库。
mysql5.6自带的四个数据库为information_schema、mysql、performance_schema、test

information_schema:保存了MySQl服务所有数据库的信息。
具体MySQL服务有多少个数据库,各个数据库有哪些表,各个表中的字段是什么数据类型,各个表中有哪些索引,各个数据库要什么权限才能访问。

mysql
保存MySQL的权限、参数、对象和状态信息。
如哪些user可以访问这个数据、DB参数、插件、主从

performance_schema
主要用于收集数据库服务器性能参数 提供进程等待的详细信息,包括锁、互斥变量、文件信息;
保存历史的事件汇总信息,为提供MySQL服务器性能做出详细的判断;
对于新增和删除监控事件点都非常容易,并可以随意改变mysql服务器的监控周期,例如(CYCLE、MICROSECOND)

3.6 select * from employees

注意:employees表数据很大。
在这里插入图片描述

四、官方提供的employees数据库的结构图

employees数据库的六张表的主外键信息一目了然:
在这里插入图片描述

五、使用DBeaver连接employees数据库

在这里插入图片描述
在这里插入图片描述

参考资料&文章

https://github.com/datacharmer/test_db
https://dev.mysql.com/doc/employee/en/sakila-structure.html
https://downloads.mysql.com/docs/employee-en.pdf
介绍Mysql安装测试数据库employees
Mysql—安装测试数据库employees
MySQL示例数据库employees.sql安装使用
安装mysql Employees 演示数据库
MySQL 示例数据库 employees 详解
解决问题:ERROR 1049 (42000): Unknown database ‘XXX’
MySQL 自带4个默认数据库
DBeaver 下载安装及配置
dbeaver安装和使用教程

猜你喜欢

转载自blog.csdn.net/qyfx123456/article/details/129679038