Using Putty to Upload SQL Database

After attempting to upload my SQL database via phpmyadmin and realizing it was too large I decided to use PuTTy instead. I connected to pincushion with my dreamhost account but have had issues. I am a bit confused about the final part of the command line used to import SQL databases. This is the line that I am using:

That part that I am confused about is the dump.sql part. Everything I enter into that returns: " -bash location I entered No such file or directory"

Where should I place the .sql file? Should I have it in a local folder or on my web directory and how do I direct to it?

Note: I am on shared hosting.


Use FTP/SFTP to upload your dump file. You can just temporarily put it in your home directory.

In your command the < is a redirect character, in this case taking the contents of the file dump.sql and using it as input for the mysql command before it. In this case, it’s assumned that dump.sql is in the same directory that we are executing the command from, but it also could include a path such as…

mysql --password=MyPass DatabaseName < .path/to/dump.sql

AND if your file is named websiteBackup140306.sql or something like that, then just chance dump.sql to websiteBackup140306.sql

I’ve put that dump on my web root( and tried

mysql–user=MyUsername --password=MyPass DatabaseName < dump.sql

That didn’t work. I tried and that didn’t work. What am I doing wrong?

I didn’t try, but if you entered you entered the name of a directory (it ends in /).

if the file is in then log in via putty and

$ cd

then run the command with < dump.sql on the end.

That did the trick, thanks!