How do I import a large sql database?


#1

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=[mysql.website.com] --user=[database username] --password=[password] [database name on dreamhost] < [database name I’m importing]

I also tried this syntax:
mysql -h [mysql.website.com] -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?

Thanks!


#2

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…


#3

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


#4

So
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 --host=yourdatabasedomain.com yourdatabase < yourfiletoimport.sql


#5

Yep, that’s what I did.