通过命令行在MySQL(Windows 8.1)上安装“Employees Sample Database”

时间:2021-04-25 00:15:55

I am trying to install the 'Employees Sample Database' in MySQL through command prompt. I have downloaded the employees_db-full-1.0.6.tar.bz2. I extracted the same and wish to install it through the command line. I am using a Windows8.1 machine.

我试图通过命令提示符在MySQL中安装'Employees Sample Database'。我已经下载了employees_db-full-1.0.6.tar.bz2。我提取了相同内容并希望通过命令行安装它。我正在使用Windows8.1机器。

Please help me with the proper commands or any other way if any. The commands on MySQL's site work for a Linux machine. Its not working for Windows. Please Help. Thanks in advance.

请帮助我使用正确的命令或任何其他方式(如果有的话)。 MySQL网站上的命令适用于Linux机器。它不适用于Windows。请帮忙。提前致谢。

2 个解决方案

#1


on windows, you should do this:

在Windows上,你应该这样做:

1, login into mysql

1,登录mysql

2, mysql>source "your employees.sql path";

2,mysql> source“your employees.sql path”;

to create a schema for the sample database. you will get error message, just ignore it. the path should be like "c:/user/sss/downloads/employees_db/employees.sql"

为示例数据库创建架构。您将收到错误消息,只需忽略它。路径应该像“c:/user/sss/downloads/employees_db/employees.sql”

3, mysql>source "your load_employees.dump path";

3,mysql> source“your load_employees.dump path”;

4, mysql>source "your load_titles.dump path";

4,mysql> source“your load_titles.dump path”;

5, mysql>source "your load_salaries.dump path";

5,mysql> source“your load_salaries.dump path”;

6, mysql>source "your load_departments.dump path";

6,mysql> source“你的load_departments.dump路径”;

7, mysql>source "your load_dept_emp.dump path";

7,mysql> source“你的load_dept_emp.dump路径”;

8, mysql>source "your load_dept_manager.dump path";

8,mysql> source“你的load_dept_manager.dump路径”;

it has to be imported in this fixed sequence, because of the database structures (dependencies of primary keys and foreign keys)

由于数据库结构(主键和外键的依赖关系),它必须以此固定顺序导入

now you should have employees database installed in your mysql.

现在你应该在你的mysql中安装了员工数据库。

good luck.

I learnt this from here

我从这里学到了这个

#2


What error do you get ?

你得到什么错误?

Are you referring to this.

你指的是这个吗?

It simply tells to import the employees.sql. That step should work on windows too.

它只是告诉导入employees.sql。该步骤也适用于Windows。

#1


on windows, you should do this:

在Windows上,你应该这样做:

1, login into mysql

1,登录mysql

2, mysql>source "your employees.sql path";

2,mysql> source“your employees.sql path”;

to create a schema for the sample database. you will get error message, just ignore it. the path should be like "c:/user/sss/downloads/employees_db/employees.sql"

为示例数据库创建架构。您将收到错误消息,只需忽略它。路径应该像“c:/user/sss/downloads/employees_db/employees.sql”

3, mysql>source "your load_employees.dump path";

3,mysql> source“your load_employees.dump path”;

4, mysql>source "your load_titles.dump path";

4,mysql> source“your load_titles.dump path”;

5, mysql>source "your load_salaries.dump path";

5,mysql> source“your load_salaries.dump path”;

6, mysql>source "your load_departments.dump path";

6,mysql> source“你的load_departments.dump路径”;

7, mysql>source "your load_dept_emp.dump path";

7,mysql> source“你的load_dept_emp.dump路径”;

8, mysql>source "your load_dept_manager.dump path";

8,mysql> source“你的load_dept_manager.dump路径”;

it has to be imported in this fixed sequence, because of the database structures (dependencies of primary keys and foreign keys)

由于数据库结构(主键和外键的依赖关系),它必须以此固定顺序导入

now you should have employees database installed in your mysql.

现在你应该在你的mysql中安装了员工数据库。

good luck.

I learnt this from here

我从这里学到了这个

#2


What error do you get ?

你得到什么错误?

Are you referring to this.

你指的是这个吗?

It simply tells to import the employees.sql. That step should work on windows too.

它只是告诉导入employees.sql。该步骤也适用于Windows。