How do I import a large sql database?

I created a new database on dreamhost and am trying to import my backup wordpress .sql file into it.

It is over the allowed 7mb so I can’t use phpmyadmin option.

I am using PuTTY, with this input:

mysql --host=[] --user=[database username] --password=[password] [database name on dreamhost] < [database name I’m importing]

I also tried this syntax:
mysql -h [] -u [username] -p[password] [database name] < [database I am trying to import.sql]

When I run these two options, nothing happens. I am on shared hosting. Is that a problem?

How would someone on dreamhost’s shared hosting plan import a wordpress .sql database file that is 100mb in size?


What do you mean when you say nothing happens?

-do you get a blinking cursor that seems like it just sits there waiting?
-or does it simply go to then next line ready for a new command?

It can take several minutes for a large database to import, so if it could be just taking some extra time…

It goes to the next line ready for a new command.

you have your .sql file uploaded onto your hosting in the root of that users directory…
You ssh in with putty
You run this command:
mysql --user=youruser --password=yourpassword yourdatabase < yourfiletoimport.sql

Yep, that’s what I did.