#cli #mysql

How to take MySQL DB back up from the command line

As you know regular backups of DB for a running site are very important. Most of the hosting providers do this for you, but sometimes its also expected from you to do the same.

The easiest way is to create a Replica of the current DB through the command line and download it.

Below is the command for doing the same. I am assuming that you are already logged in your server through ssh.



It will ask for the password but you can handle it.

Moreover, if you want to take backup of particulate tables from the database you have to pass the name of the tables separated by space.


Feel free to ask in the comment section in case of any doubt.


Hi, I am Samgan, I know the adds are bit annoying but i hope you understand. Talking about me, I excel at solving complex problems involving logic and step by step breakdown of the problem. Besides, to develop complex algorithms, I specialize in problem framing, systems design, and product development strategy. Sometimes I also enjoy public speaking.  

I am also the creator of penit.ink, a site which provides young writers with a free hand place to show their creation to the world. Irrespective of the niche, if you write this place is defiantly for you.