Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a large local SQL database. When I try to upload the file to the remote database I get a message saying the file is too large.

My hosting provider told me I need to upload the SQL database to remote server using Terminal on Mac.

I need to know the Terminal commands to connect and upload the file.

share|improve this question

migrated from Jun 27 '11 at 10:38

This question came from our site for professional and enthusiast programmers.

which database software? – Sathya Jun 27 '11 at 9:57
phpMyAdmin 2.9.0. I tried: mysql -u user -p database. But I get the message "-bash: mysql: command not found" – chefnelone Jun 27 '11 at 10:04
up vote 1 down vote accepted

First install the mysql client for Mac, I don't know the specifics on how that is done, sorry.

Then if the mysql client works the same way as on linux, the dump command would be something like:

mysqldump -u user -p databasename > dump.sql

Then using SCP or a graphical sftp software, transfer the file to the remote server:

scp dump.sql user@remotehost.ip:

Then use the mysql client there to import the dump.sql with:

mysql -u user -p databasename < dump.sql

You might need to create an empty database with the desired name before you import the dump.

share|improve this answer
I now know that the problem is that I have not installed mysql in local. But I do have installed MAMP and it include mysql. Don't know if I have to install mysql in other way than trough MAMP ??¿¿ – chefnelone Jun 27 '11 at 10:47
MAMP MySQL via Command line:… – red Jun 27 '11 at 10:48
I saw the page you linked me but it show how to run commands on local machine. Once I am in mysql> can I connect to a remote database. How? – chefnelone Jun 27 '11 at 16:34
You must SSH into the remote server to run the mysql import command I listed there. As my answer says, first you run the two local commands, and then SSH into the remote machine to run the last command. – red Jun 28 '11 at 11:09
ok I see, I'll try that. – chefnelone Jun 30 '11 at 6:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.