Problem loading sql file into database


#1

Hi. I have a rather large sql file (45 MBs) that I need to load into my MySQL database. I’ve uploaded it to my ftp space, and I have been following the instructions on how to get it to load, but when I type in the commands, I just get the > prompt. It does nothing at all. It’s like it cant find the file. I’m really getting desperate here. What am I doing wrong?
And yes, I have enabled shell on my account. :slight_smile:


#2

what command are you using to dump the data? That is most likely to be where your problem is. Why not copy and paste exactly as you are using it (just blank out the user/[pass info)

-Matttail


#3

Ive been using this one. And the file IS in my ftp space, but it just cant seem to see it.

mysql -u[username] -p[password] database <[path/filename.sql]


#4

Shouldn’t it be this to do the dump?:

mysql[color=#CC0000]dump --opt[/color] -u[username] -p[password] [color=#CC0000]-h[hostname][/color] database [color=#CC0000]> [/color][path/filename.sql]

And then this to restore it?:

mysql -u[username] -p[password] -h[hostname] database < [path/filename.sql]


Simon Jessey
Keystone Websites (business site) | si-blog (personal site with affiliate links)


#5

When I enter the path, do I need the www or http as well?


#6

no, you don’t want the www part. you need to give it the path as the server will see it. assuming you’ve uploaded the sql file to your home directory, the one you’re first put into when you FTP or ssh in, you wouldn’t need a directory at all, just the file name.

Also, don’t forget to specify both the host name and database name as shown above, that’s probably your main issue.

Also, Simon was right, I shouldn’t have said “… command to dump” but the command to load the database. A dump backups up data, not restores it. sorry for the confusion.

-Matttail