Importing database help winscp


#1

Hello i have been useing WinSCP to export my databases every month incase i ever needed a backup.
the command is

mysqldump --opt --user=username --password=password --host=yourMySQLHostname dbname > output.sql

What i would like to learn is the command to import one of these databases once i have uploaded one to my site again.


#2

From the command line, not inside MYSQL:

mysql -u username -p -h mysql.hosting.com database-name < data.sql

And my memory is a little fuzzy since different hosts have different little details, so I can’t remember if it was DH where this didn’t work. In that case, mysqlimport might instead:

mysqlimport [options] db_name textfile1 [textfile2 …]

Of course, if it is a smaller file, you can always try phpmyadmin! That is probably the easiest way.


#3

still a bit unclear on this.

like this?
mysql -u username -p -h mysql.hosting.com database-name < data.sql
mysql -u=username -p=password -h=mysql.hosting.com database-name < data.sql

are the = not needed and can u be used instead of username=

can’t use phpadmin dreamhost is too weak to have that work right on large database.


#4

I’ve answered this on the related thread “Can I increase the SQL max file size?” at:

http://discussion.dreamhost.com/thread-133612-post-148139.html#pid148139