HOW TO MySQL DUMP from terminal

User Avatar
👤 admin
🔴 Admin
✍️ The most important thing in the world is to not be alone.
⏳ Last active: 23 Sep 2025 at 14:41
📅 Created: 14 Feb 2021 at 20:10
👀 Viewed: 157 times
✉️ Send Email

You can create mysqldump like this:


mysqldump --defaults-extra-file=/path/to/config.cnf

create config.cnf:


[client]

user = whatever

password = whatever

host = whatever

Now lets backup a database


mysqldump --defaults-extra-file=/path/to/config.cnf database > /root/export.sql

mysqldump: [Warnings] Using a password on the command line interface can be insecure.

It's not the best practice because the password is in a file and not encrypted!

If you want to comment: Login or Register