使用vagrant导入数据库mysql。无此文件或目录

编程入门 行业动态 更新时间:2024-10-28 16:26:02
本文介绍了使用vagrant导入数据库mysql。无此文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在一个名为test_db-master的文件夹中有一个示例数据库。我需要确保zip文件在我的vm的/ vagrant目录。我相信这意味着我必须保存这个db文件夹在我从中运行vagrant up和ssh命令的目录,我已经这样做了。

I've got a sample database in a folder called test_db-master. I'm required to "make sure the zip file is in the /vagrant directory of my vm". I believe that means that I have to save this db folder in the directory from which I run the vagrant up and ssh commands and I've done that.

得到vagrant(mac上的虚拟框),我ssh进入vagrant后,我需要运行以下命令:

I've got vagrant (virtual box on mac) and after I ssh into vagrant I'm required to run the following command:

mysql -u root -p < employees.sql

在我运行上面的命令后,终端给我这个消息:

After I run the above command, terminal gives me this message:

-bash: employees.sql: No such file or directory

我已经看完了,找不到解决方案。显然,我应该看到雇员数据库一旦我登录到mysql,我不。这是我第一次深入到VMs,mysql,apache等的世界(使用LAMP)。任何帮助将不胜感激。

I have looked all over and can't find a solution. Apparently I'm supposed to see the employees database once I login to mysql and I don't. This is my first time delving into the world of VMs, mysql, apache etc (Working with LAMP). Any help will be appreciated.

推荐答案

很可能是SQL文件的完整路径是必需的,可以在命令中指定 mysql -u root -p < \Path\To\File\employees.sql

It would most likely be that the full path to the SQL file is required, either specify it in the command mysql -u root -p < \Path\To\File\employees.sql

或确保您在运行命令。

cd \Path \To\File\

更多推荐

使用vagrant导入数据库mysql。无此文件或目录

本文发布于:2023-10-09 10:13:03,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1475467.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:无此   数据库   文件   目录   vagrant

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!