简体   繁体   English

MySQL Workbench 不检测 .dump 文件

[英]MySQL Workbench doesn't detect .dump files

    20:07:08 Restoring C:\prog\test_db-master\employees.sql
Running: mysql.exe --defaults-file="c:\users\ariell~1\appdata\local\temp\tmp2jypno.cnf"  --protocol=tcp --host=localhost --user=root --port=3306 --default-character-set=utf8 --comments --database=employees  < "C:\\prog\\test_db-master\\employees.sql"
ERROR at line 113: Failed to open file 'load_departments.dump', error: 2

Operation failed with exitcode 1
20:07:09 Import of C:\prog\test_db-master\employees.sql has finished with 1 errors

I am trying to import the sample Employees DB from the MySQL site from Workbench, but the program for some reason cannot read the .dump files that are in the same directory as the employees.sql that I pointed Workbench to.我正在尝试从 Workbench 的 MySQL 站点导入示例员工数据库,但由于某种原因,该程序无法读取与我将 Workbench 指向的员工.sql 位于同一目录中的 .dump 文件。

employees.sql at line 112-113 reads: 112-113 行的雇员.sql 内容如下:

SELECT 'LOADING departments' as 'INFO'; source load_departments.dump ;

And it continues like such with the rest of the .dump files.其余的 .dump 文件也是如此。 These files aren't corrupted, I can open them in Notepad, and it is just the usual INSERT-INTO SQL queries.这些文件没有损坏,我可以在记事本中打开它们,这只是通常的 INSERT-INTO SQL 查询。

It only works if i select each .dump file manually to import.仅当我手动选择每个 .dump 文件进行导入时才有效。 Why is this?为什么是这样?

Open employees.sql in editor.在编辑器中打开employees.sql。 in line 112-113 you have:在第 112-113 行,您有:

"SELECT 'LOADING departments' as 'INFO';
source load_departments.dump ;"

AND NOW change the second line to:现在将第二行更改为:

source C:/load_departments.dump ;

(If you have your file load_departments.dump just in C:) or enter path to any folder You have Your .dumb files /and later sql file/. (如果你的文件 load_departments.dump 只是在 C: 中)或者输入任何文件夹的路径你有你的 .dumb 文件/和更高版本的 sql 文件/。 do the same with next paths to files in employees.sql对employees.sql 中文件的下一个路径执行相同操作

You can also change environment path but the one I described is much simpler I think您也可以更改环境路径,但我认为我描述的要简单得多

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM