How to backup mysql database on ubuntu server

in #server8 years ago (edited)

How to backup mysql database on ubuntu server

Here is how to backup mysql database on ubuntu server, mysql database user "groovy"
password "XgjtCbnhZffdnbbf" mysql database data will be copied to a file "groovydump.sql"

login to ssh

login as: root
[email protected]'s password:
Welcome to Ubuntu 12.04.5 LTS (GNU/Linux 2.6.32-042stab083.2 x86_64)

* Documentation:  https://help.ubuntu.com/
No mail.
Last login: Tue Jul  5 21:49:35 2016 from 41.203.71.186

root@stoli:~# mysqldump -ugroovy -pXgjtCbnhZffdnbbf --all-databases > groovydump.sql
root@stoli:~# ls
groovydump.sql  install.sh  Maildir  virtualmin-install.log

To restore dump

root@stoli:~# mysqldump -ugroovy -pXgjtCbnhZffdnbbf [database_name] < groovydump.sql

Coin Marketplace

STEEM 0.27
TRX 0.21
JST 0.039
BTC 97426.90
ETH 3593.28
USDT 1.00
SBD 3.88