简体   繁体   English

如何使用cloud9从Ruby中的Ruby导入SQL文件到MySQL数据库?

[英]How import from sql file to mysql db in ruby on rails using cloud9?

I added file dump.sql to my project in folder db Dump volume 2,5 gb 我在文件夹db Dump volume 2,5 gb中的项目中添加了dump.sql文件

Next my steps: 接下来我的步骤:

mysql-ctl cli 
mysql> use c9
mysql> source /home/ubuntu/workspace/myproject/db/dump.sql

displayed error: 显示的错误:

Failed to open file '/home/ubuntu/workspace/myproject/db/dump.sql', error: 2

How can I solve this error? 我该如何解决这个错误?

From the command line, change directory to whatever directory your dump.sql file is located in and then run: 在命令行中,将目录更改为dump.sql文件所在的目录,然后运行:

mysql -u username -p c9 < dump.sql


Source: Run .sql file through command line in MySQL 来源: 在MySQL中通过命令行运行.sql文件

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

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