Importing Large Database tables with Putty

apps

#1

Hi,

In the past, at other hosts, I have used bigdump to parse large files into batches for the mysql database. For whatever reason this isn’t allowed here since it throws an error and I see utterly no mention of it at wiki or the forums.

I found wiki entries, as well as forum entries on importing large databases. I downloaded Putty and worked from the instructions at DH’s wiki, Migrate MySQL http://wiki.dreamhost.com/index.php/Migrate_MySQL

However, putty tells me that the backup table i FTP’d to the server doesn’t exist.

Here’s how I write the commands:

mysql -hdb.mysite.com -uusername -ppassword databasename < db_backeduptableonmylocaldrive.sql

Putty tells me my file, db_backeduptableonmylocaldrive.sql, doesn’t exist on the server.

Is there any other files out there which might give me a couple of klewx4s upside the head?

Thanks,

Kelley

Other files I consulted at wiki:

http://wiki.dreamhost.com/index.php/SSH
http://wiki.dreamhost.com/index.php/PuTTY


#2

Kelly,

Have you tried including the full path to the .sql file in the command line? Something like:

mysql -hdb.mysite.com -uusername -ppassword databasename < /home/user/db_backeduptableonmylocaldrive.sql
(assuming you ftp’ed the .sql file to the “root” of your user space, not your “web accessible” directory).

–rlparker


#3

Well you need to find your file… ls will help
ls -la
will show you if your file is where you think…
maybe is on a subdirectory and need to move the file with mv or make your
mysql … < directory/db_backeduptableonmylocaldrive.sql

Anyway I recomend winscp [winscp.net/] for upload files instead of ftp :smiley:

Rethinking the thing, maybe find will serve you more!

find ./ -name “*.sql”

on my case returns
./DB/portal.sql

you can do mysql… < ./DB/portal.sql

Regards


#4

Good post! Much “mo’ better” than mine, because he does need to find the file first, eh?

Thanks for pointing him to where I should have! :wink:

–rlparker


#5

Well,

I thank you both. True, while I thought I’d placed the file in root, it seemed to have poof vanished. I moved it there, ran ls -la and voila! there is was.

i ran the commands again, but I did so without home/user/ as you suggested rlparker.

Right now, there’s no error message, just the green block at command prompt. I’m not sure what that means, though. Um, well, garsh. I looked at MySQL and the files have been imported. yes!

Alas, this seems to have broken the blog because, while it’s linking to the style sheet properly, there is no stylesheet via port 80. Can see it there with FTP, it just doesn’t come up in a browser. Odd.

Could the fact that I only uploaded comments and not posts yet whack the front end of the blog like this?

Hmmm.

Well, I’ll finish uploading posts and see what happens. TG for default themes, eh?

Thanks much for the help.


#6

Thanks for the tip about WinScp btw.