A
A
Alexey Rekozuby2016-01-26 11:46:14
MySQL
Alexey Rekozuby, 2016-01-26 11:46:14

How to backup MySql from terminal (ubuntu-server) of all databases?

Good afternoon, there is a task to transfer all databases from one OS server "ubuntu-server" to another running "ubuntu-server 14.04". I have not come across this issue before, so I ask for a detailed answer with possible comments. Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Mitrushchenkov, 2016-01-26
@AlekseySapsan

Hello. You need to ssh into the current hosting and dump all the databases that you have. To do this, in the terminal you need to enter:
Next, go to the new server and execute another command (do not forget to transfer the created file to the new server, of course):
The main thing is that you have root access to the database in order to avoid mismatch of privileges on the tables.
The first command dumps the database, where the -u parameter is the username, and -p , if I'm not mistaken, the password flag that you will enter after pressing enter. According to the --all-databases parameter, I think everything is clear.
The dump file after the command is executed will be located in the directory where you will be at the time the command is executed.

A
Andrey Mokhov, 2016-01-26
@mokhovcom

mysqldump --help
...
Dumping structure and contents of MySQL databases and tables.
Usage: mysqldump [OPTIONS] database [tables]
OR     mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]
OR     mysqldump [OPTIONS] --all-databases [OPTIONS]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question