-2

Im am trying to get the following script to import a database. Every time I run the script I get a

mysql -u username -pmypassword my_database < /var/hostdata/databases/my_database.sql
-bash: /var/hostdata/databases/my_database.sql: No such file or directory.

At one point this script would work for me but now it isn't. Also everything I am reading online say this should work but obviously its not. What am I doing wrong? I am running MySQL 5.5.41 on Ubuntu 12.04.

thebradnet
  • 21
  • 1
  • 5

1 Answers1

0

It sounds like /var/hostdata/databases/my_database.sql is MIA as error states

No such file or directory.

make sure file actually exists on file system by issuing:

ls -1 /var/hostdata/databases/my_database.sql

mysql import command is correct, you just need to make sure you're importing an actual mysql dump.

alexus
  • 13,112
  • 32
  • 117
  • 174
  • I am an idiot. I ran the ls -l and it did not find the file. So I went into the directory and noticed that instead of using an underscore I had a dash. I apologize. I worked on this for about an hour or 2 the other day. – thebradnet Mar 03 '15 at 15:32
  • @thebradnet don't beat yourself up, feel free to accept my answer) – alexus Mar 03 '15 at 17:51