HOW TO MySQL DUMP from terminal

Post Reply
User avatar
sonik
Site Admin
Posts: 37
Joined: 12 Nov 2018, 22:12

HOW TO MySQL DUMP from terminal

Post by sonik » 13 Nov 2018, 11:01

If you have an error like this:
mysqldump: [Warnings] Using a password on the command line interface can be insecure.
You can create mysqldump like this:

Code: Select all

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

Code: Select all

[client]
user = whatever
password = whatever
host = whatever
Now lets backup a database

Code: Select all

mysqldump --defaults-extra-file=/path/to/config.cnf database > /root/export.sql
It's not the best practice because the password is in a file and not encrypted!

Post Reply