How to backup database from the commandline?

Discussions related with hosting control panels used, which include cPanel, Plesk, Directadmin etc..

Moderator: Staff

Post Reply
Jackk
Posts: 0
Joined: Fri Apr 13, 2018 7:18 pm

How to backup database from the commandline?

Post by Jackk »

Hello,
How to backup the database from the commandline?


Tommy
Posts: 0
Joined: Wed Sep 09, 2020 12:10 pm

Re: How to backup database from the commandline?

Post by Tommy »

Hello Jackk,

Please use the below command for taking database backup

mysqldump database_name > database_name.sql

and also restore from backup use below command

mysql database_name < database_name.sql


steve
Site Admin
Posts: 5
Joined: Tue Mar 10, 2015 12:41 am
Contact:

Re: How to backup database from the commandline?

Post by steve »

Hello,

You have multiple options.. The above mentioned option is to take backup and restore the database from the commandline ( cli ). Additionally, you can take db backup using the phpmyadmin export database option, which is more convenient for normal users.


-
Steve N
Support Staff
Nixtree Solutions LLP
cPanel Server management | Managed Backup Solutions | Outsourced Web Hosting support
If you are looking for assistance in server management, please get in touch with our support.
Post Reply