It’s the quick and easy method to take backup of database via command line.
First connect Mysql server to command line with below command.
After that enter Mysql user password and then press enter. To check the database name of which you want to take backup then you have to enter below command.
Now you want to take backup of database named “mysqldatabase”.
From previous command we have backup database mysqldatabase into mysqldatabase-backup.sql.
With this command we have combine all three databases like mysqldatabaseone mysqldatabasetwo mysqldatabasethree into sql dump file database-backup.sql.
First connect Mysql server to command line with below command.
Code:
mysql -uusername -p // Replace username with your username.
Code:
Show databases.
Code:
mysqldump mysql-database > mysqldatabase-backup.sql
Code:
mysqldump --databases mysqldatabaseone mysqldatabasetwo mysqldatabasethree > database-backups.sql