large database file import help
Posted by: captivereefs
Posted on: 2009-08-19 15:19:00
How do I go about importing a 50 mb sql dump file into mysql? I've tried several different scripts but still have not had any sucess.
Posted by: captivereefs
Posted on: 2009-08-19 15:19:00
How do I go about importing a 50 mb sql dump file into mysql? I've tried several different scripts but still have not had any sucess.
Posted by: Atropos7
Posted on: 2009-08-19 15:37:00
In reply to:How do I go about importing a 50 mb sql dump file into mysql? I've tried several different scripts but still have not had any sucess.
You're not going to be able to do that with a CGI script (eg PHPMyAdmin, etc) because the process will be killed for taking too long.
Try it from a shell. See http://dev.mysql.com/doc/refman/5.1/en/batch-mode.html
Customer since 2000
openvein.org
Posted by: captivereefs
Posted on: 2009-08-19 15:54:00
I was told to try to ssh it using this command:
$ mysql -h [hostname] -u [uname] -p[pass] [db_to_restore] < [backupfile.sql]
When I try to connect via Terminal (on a mac), the server is kicking me back off with the message that I can only ftp. Is there a setting to allow an ssh connection?
Posted by: Atropos7
Posted on: 2009-08-19 15:56:00
Yes. Login to the DreamHost Web Panel and go to Users -> Manager Users.
Customer since 2000
openvein.org
Posted by: captivereefs
Posted on: 2009-08-19 18:11:00
Well I'm still stumped. I have made progress though. I am able to ssh into the shell, but when I enter the above command (with my password, etc, and the sql file is called dump.sql), I am getting the following error:
-bash: [dump.sql]: No such file or directory
I have chmoded the permissions to 777 and I am in the same directory as the dump.sql file when I am running the command. Still get the no such file message. Any ideas what I am doing wrong?
Can anyone confirm the syntax of the command, asumming I am running it from the same directory containing backupfile.sql:
$ mysql -h [mysql.mydomainname.com] -u [dbaseusername] -p[dbpassword] [db_to_restore] < [backupfile.sql]Edited by captivereefs on 08/19/09 06:39 PM (server time).
Posted by: Atropos7
Posted on: 2009-08-19 18:50:00
In reply to:ell I'm still stumped. I have made progress though. I am able to ssh into the shell, but when I enter the above command (with my password, etc, and the sql file is called dump.sql), I am getting the following error:
-bash: [dump.sql]: No such file or directory
Here's a tip. Bash has an auto-completion where it if you start typing in a string and then hit TAB it will scan the filesystem and try to complete the string.
$ mysql -h [mysql.mydomainname.com] -u [dbaseusername] -p[dbpassword] [db_to_restore] < d
then hit the TAB key and Bash will try to find a file in the current directory starting with the letter d. Obviously if there is more than one it won't do anything. But if you hit TAB again it will show a list of files starting with the letter d. If you know there is more than one that starts with d, you can type du before hitting TAB.
Customer since 2000
openvein.org
Posted by: captivereefs
Posted on: 2009-08-20 09:31:00
I finally got it to work. Besides having syntax issues, I also had some extra lines in the dump file that the text editor added <doh>. The tab trick is good to know. Thanks for all your help.