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

45 篇文章 0 订阅
7 篇文章 0 订阅

一、下载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安装和使用教程

  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
mysql示例数据库 employee,这个大家也可以到github官网下载。 https://github.com/datacharmer/test_db test_db A sample database with an integrated test suite, used to test your applications and database servers This repository was migrated from Launchpad. See usage in the MySQL docs Where it comes from The original data was created by Fusheng Wang and Carlo Zaniolo at Siemens Corporate Research. The data is in XML format. http://timecenter.cs.aau.dk/software.htm Giuseppe Maxia made the relational schema and Patrick Crews exported the data in relational format. The database contains about 300,000 employee records with 2.8 million salary entries. The export data is 167 MB, which is not huge, but heavy enough to be non-trivial for testing. The data was generated, and as such there are inconsistencies and subtle problems. Rather than removing them, we decided to leave the contents untouched, and use these issues as data cleaning exercises. Prerequisites You need a MySQL database server (5.0+) and run the commands below through a user that has the following privileges: SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, REFERENCES, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW Installation: Download the repository Change directory to the repository Then run mysql < employees.sql If you want to install with two large partitioned tables, run mysql < employees_partitioned.sql Testing the installation After installing, you can run one of the following mysql -t < test_employees_md5.sql # OR mysql -t < test_employees_sha.sql For example: mysql -t < test_employees_md5.sql +----------------------+ | INFO | +----------------------+ | TESTING INSTALLATION | +----------------------+ +--------------+------------------+----------------------------------+ | table_name | expected_records | expected_crc | +--------------+------------------+----------------------------------+ | employees | 300024 |

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值