【问题标题】:MySQL Employee Database installMySQL员工数据库安装
【发布时间】:2017-06-12 09:36:42
【问题描述】:

我在安装这个数据库时遇到了很多困难。我已经查看并尝试了许多不同的导入方法,但仍然没有。我知道这可能之前已经发布过,但我找不到答案来完成这项工作。

似乎没有任何东西可以看到 .DUMP 文件,但肯定存在;

What the Temp Directory looks like

我正在使用新版本的 WAMP,我可以使用它来安装 “Sakila DB”

我已将完整文件从https://github.com/datacharmer/test_db 解压缩到以下目录; C:\temp\test_db-master

然后我从这个位置用 CMD 打开 MySQL 应用程序:C:\Users\skino>"C:\Program Files\MySQL\MySQL Workbench 6.3 CE\mysql.exe" -u root -p

这会给我MySQL>提示

在此之后,我使用以下命令 CD 到目录并加载 SQL。

源 C:/temp/test_db-master/employees.sql

然后我得到以下信息......谁能告诉我我哪里出错了

mysql> SOURCE C:/temp/test_db-master/employees.sql
Query OK, 8 rows affected (0.91 sec)

Query OK, 1 row affected (0.00 sec)

Database changed
+-----------------------------+
| INFO                        |
+-----------------------------+
| CREATING DATABASE STRUCTURE |
+-----------------------------+
1 row in set (0.00 sec)

Query OK, 0 rows affected, 6 warnings (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

+------------------------+
| INFO                   |
+------------------------+
| storage engine: InnoDB |
+------------------------+
1 row in set (0.00 sec)

Query OK, 0 rows affected (0.23 sec)

Query OK, 0 rows affected (0.56 sec)

Query OK, 0 rows affected (0.29 sec)

Query OK, 0 rows affected (0.31 sec)

Query OK, 0 rows affected (0.38 sec)

Query OK, 0 rows affected (0.31 sec)

Query OK, 0 rows affected (0.03 sec)

Query OK, 0 rows affected (0.05 sec)

Query OK, 0 rows affected (0.00 sec)

+---------------------+
| INFO                |
+---------------------+
| LOADING departments |
+---------------------+
1 row in set (0.00 sec)

ERROR:
Failed to open file 'load_departments.dump', error: 2
+-------------------+
| INFO              |
+-------------------+
| LOADING employees |
+-------------------+
1 row in set (0.00 sec)

ERROR:
Failed to open file 'load_employees.dump', error: 2
+------------------+
| INFO             |
+------------------+
| LOADING dept_emp |
+------------------+
1 row in set (0.00 sec)

ERROR:
Failed to open file 'load_dept_emp.dump', error: 2
+----------------------+
| INFO                 |
+----------------------+
| LOADING dept_manager |
+----------------------+
1 row in set (0.00 sec)

ERROR:
Failed to open file 'load_dept_manager.dump', error: 2
+----------------+
| INFO           |
+----------------+
| LOADING titles |
+----------------+
1 row in set (0.00 sec)

ERROR:
Failed to open file 'load_titles.dump', error: 2
+------------------+
| INFO             |
+------------------+
| LOADING salaries |
+------------------+
1 row in set (0.00 sec)

ERROR:
Failed to open file 'load_salaries1.dump', error: 2
ERROR:
Failed to open file 'load_salaries2.dump', error: 2
ERROR:
Failed to open file 'load_salaries3.dump', error: 2
ERROR:
Failed to open file 'show_elapsed.sql', error: 2
mysql> 

【问题讨论】:

标签: mysql installation wampserver failed-installation


【解决方案1】:

我的猜测是,您安装的 MYSQL Workbench 版本还附带 MYSQL 实例。所以现在你已经安装了 2 个 MYSQL 服务器。

您正在加载一个,然后在另一个中查找数据库。

卸载 MYSQL Workbench 和它附带的 MYSQL 实例。这将只留下 WAMPServer 附带的 MYSQL。

然后重新安装MYSQL Workbench,不要选择安装数据库服务器。

然后您可以将 Workbench 连接到 WAMPServer 附带的 MYSQL。

【讨论】:

  • 绝对正确。我从逻辑上没有想到这一点。我认为引起我问题的另一件事是我没有 CD 到 SQL 文件开始的目录中。现在全部启动并运行。非常感谢。
【解决方案2】:

您需要做的就是:打开 MySQL 工作台。然后 FILE > RUN SQL SCRIPT 选择 employees.sql 文件。简单的运行。 祝你好运

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-11-12
    • 2015-02-18
    • 1970-01-01
    • 2018-12-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多