Search code examples
mysqlruby-on-railscloud9-ide

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

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?


Solution

  • From the command line, change directory to whatever directory your dump.sql file is located in and then run:

    mysql -u username -p c9 < dump.sql


    Source: Run .sql file through command line in MySQL