Question: I cannot find a solution to this particular demand.
I have a mysql dump on my computer and I want to import it in a web server using SSH. 
How do I do that ? 
Can I add the ssh connection to the mysql command ?

Edit :
I did it with SCP

```
scp -r -p /Users/me/files/dump.sql user@server:/var/www/private
mysql -hxxx -uxxx -pxxx dbname < dump.sql

```

Answer: 
You can try this solution for your problem : 

**Login using SSH details :-**

```
SSH Host name : test.com
SSH User : root
SSH Password : 123456

```

**Connect SSH :-**

```
ssh root@test.com
enter password : 123456

```

**Login MySQL :-**

```
mysql -u [MySQL User] -p
Enter Password :- MySQL Password

```

**Used following command for Import databases :-**

```
show databases; // List of Databased
use databasedname; // Enter You databased name to Import databased
source path;  // Set path for Import databased for ex : /home/databased/import.sql 

```

I hope this will helps you.
Yes, you can do it with one command, just use 'Pipeline' or 'Process Substitution'

**For your example with 'Pipeline':**

```
ssh user@server "cat /Users/me/files/dump.sql" | mysql -hxxx -uxxx -pxxx dbname

```

or use 'Process Substitution':

```
mysql -hxxx -uxxx -pxxx dbname < <(ssh user@server "cat /Users/me/files/dump.sql")

```

**Example 2, get database dump from remote server1 and restore on remote server2 with 'Pipeline':**

```
ssh user@server1 "mysqldump -uroot -p'xxx' dbname" | ssh user@server2 "mysql -uroot -p'xxx' dbname"

```

or 'Process Substitution':

```
ssh user@server2 "mysql -uroot -p'xxx' dbname" < <(ssh user@server1 "mysqldump -uroot -p'xxx' dbname")

```

*Additional links:*

*what is 'Process Substitution':*

<http://www.gnu.org/software/bash/manual/html_node/Process-Substitution.html>

*what is 'Pipeline':*

<http://www.gnu.org/software/bash/manual/html_node/Pipelines.html>