Connect with us

Hi, what are you looking for?

Linux

How to Backup MariaDB or MySQL DB using mysqldump on Ubuntu 16.04 and CentOS 7

How to Backup MariaDB / MySQL Database using mysqldump on Ubuntu 16.04 / CentOS 7 / RHEL 7 / Debian 9 / 8 . The MariaDB / MySQL Database are the most popular RDBMS (Relational Database Management System) and It is used by most of the Web Applications. That’s why backup plays most important aspect to secure your database. The mysqldump is the command that is useful to take backup in various output format. It is useful when all the backup is taken in single file that is useful for database restoration purpose. Also the mysqldump is also useful to take backup of data in various time interval using crontab to schedule backup of database. This tutorial explains how to take complete the database backup using mysqldb command.

Backup all the database

This command is useful when you take the compete backup of your database.

Syntax of command

# mysqldump –all-database -u databaseusername -p > path of destination where backup can be stored

Example command
# mysqldump --all-database -u databaseusername -p > /home/techbrown/full-backup.sql

Backup a single database

This command is very useful when you take backup of single selected database.

Syntax of command

# mysqldump -u databaseusername -p databasename > path of destination where backup can be stored

Example command
# mysqldump -u root -p techbrowndatabase > /home/techbrown/techbrowndatabase.sql

Backup a selected tables from a database

This command is very useful when you select the tables from a database and output in text format.

Syntax of command

# mysql databasename -e “SELECT tablename1, tablename2, tablename3 \ FROM databasename” > path of destination where backup can be stored

Example command
# mysql techbrowndatabase -e "SELECT user1, user2, user3 \ FROM techbrowndatabase" > /home/techbrown/techbrowndatabase.txt

Final Words

Finally you have completed all steps to enable the database backups using the mysqldump commands on your respective Linux distributions. Now you have to keep a backup ready to secure your system. If you have any queries then use the comment section for help and support.

Advertisement. Scroll to continue reading.
Comments
Advertisement
Advertisement

Linux

DNF stands Dandified YUM and this is the default package manager for RHEL 8 / CentOS 8.  This tutorial explains you how to create...

Linux

If you forget a root password of your RHEL 8 and CentOS 8 and want to reset the password so that the RHEL 8...

Windows

How to auto upgrade JioFi firmware for JioFi 2 / JioFi 3 / JioFi 4 / JioFi 5 / JioFi 6 and other JioFi...

Linux

How to Upgrade WordPress Server from Ubuntu 16.04 to Ubuntu 18.04. Right now, Ubuntu 18.04 has been released with tons of new features. Upgrading...

Linux

How to Enable TLS 1.3 on Nginx Web Server. Nginx is a ultra fast web server optimized for modern web applications and servers. TLS...

Advertisement

You May Also Like

Windows

How to auto upgrade JioFi firmware for JioFi 2 / JioFi 3 / JioFi 4 / JioFi 5 / JioFi 6 and other JioFi...

Linux

DNF stands Dandified YUM and this is the default package manager for RHEL 8 / CentOS 8.  This tutorial explains you how to create...

Windows

How to download and install the Mobile Intel 4 Series Express Chipset Graphics Drivers for Windows 10.  Windows 10 is the one of the...

Windows

How to Install and Configure PCSX2 on Windows 10. The Windows 10 is the most recommended operating system for the Games. In stream platform...