A
A
Andrey Astafiev2018-02-22 12:36:51
linux
Andrey Astafiev, 2018-02-22 12:36:51

How to dump a mysql database and download it locally to a computer?

via ssh I connect to the server ssh [email protected] -p номер_порта
there, stand is deployed lxc shell name_stand
on the stand, I do a dump mysqldump -u USERNAME DBNAME -p > /tmp/dump.sql
, now I would download it locally myself, can I do something? Or use another algorithm of actions?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
T
Twelfth Doctor, 2018-02-22
@Astafiev_Andrey

lxc exec namestand -- mysqldump -u USERNAME DBNAME -p > /tmp/dump.sql
lxc file pull name_stand/tmp/dump.sql /path/to/your/local/dump/file.sql

And then via FTP from this server download the file /path/to/your/local/dump/file.sql

S
synapse_people, 2018-02-22
@synapse_people

SCP download via shell

O
Oleg, 2018-02-22
@402d

> /path from where you can download/dump.sql

V
Victor Taran, 2018-02-22
@shambler81

mysqldump -uroot -ppass -P3386 dbname > dbname.sql
without spaces between the argument and value, and -p is the password port with a capital letter, you may also need a host other than localhost, look in the software settings for what is indicated there.
in more detail mysqldump --help
Also, you did not give data on what you have with your computer, maybe you have ftp there. or from this side of the site.
If the site is then you can simply pick up the file via a direct link.
or put phpmyadmin

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question