Upload mysql database?


#1

Can you please help me how do I upload a database dump from the shell. I’m on OS X. What’s the Terminal command for it?
Thanks!


#2

Hi,

Got same problem, my database is too big, and got time exec error.

I try with bigdump.php, but on dreamhost, it doesn’t work.

So, what is the solution to uplaod big file of mysql.

Don’t know shell, putty, …and it looking difficult.

Bye.


#3

Haven’t tried OS X, but I believe that the following will work:

mysql --host=[i]DBSERVER[/i] --user=[i]DBUSER[/i] --password=[i]DBPASSWORD[/i] [i]DBNAME[/i] < [i]dump.sql[/i]where DBSERVER is the MySQL server name (e.g. mysql.yourdomain.com), DBUSER is your MySQL username, DBPASSWORD your MySQL password, DBNAME the name of the database and dump.sql is the file with your database dump.

You can run mysql --help to see all the options.


Earn FREE HOSTING through DreamHost Rewards!
Current promo: Code Monster!


#4

do i have to connect to Dreamhost first? Or is the mysql application running from the local machine?


#5

I’m not sure if I understand your questions correctly, but I will try to explain…

Yes, you have to connect to DreamHost first…

First you have to enable ssh/telnet for you username at DreamHost. You do that by choosing Users in the Control Panel. Check “Enable ssh/telnet”.

Now you can connect to the shell environment at DreamHost. On Windows I use a telnet/SSH client called PuTTY. On OS X I believe you can use the Terminal to connect to DreamHost’s server.

Try something like:


Earn FREE HOSTING through DreamHost Rewards!
Current promo: Code Monster!


#6

You can connect directly from your home (or office) computer to your DreamHost mysql database. In order to do this you will need to configure the list of allowed hosts for you database username to include your current ip address. If you want to do this, go to Goodies->MySQL in the control panel. Then select modify next to the mysql username that you will be using, and add your current ip address (shown on the page) to the list of allowed hosts.

Goodies->MySQL in the control panel also shows the mysql command line syntax for connecting to your specific database(s).

BTW, at least for me, this is one control panel change that seems to be applied instantaniously…

-Mark.


#7

thanks guys for the help. it looks like it’s working without connecting even by using a local mysql. i can see it is uploading it slowly. very slowly actually… just 600B/s. is that normal?


#8

Try with bigdump.php

I succes to do with it, just upload your file.sql and the file bigdump.php in a rep, after edit bigdump.php, and in the conf indicate the filename of your .sql, and all is fine.

Bye.


#9

on bigdump.php i have to edit the upload path manually in order to get it to work


#10

[quote]Try with bigdump.php

[/quote]

God - they really should rename that one.