megacolorboy

Back

Published on April 10th, 2021

Unix

How to perform mysqldump without a password prompt?

If you're performing a mass database backup using , you'll pretty much find it annoying to type in the password every single time.To get rid of it, open configuration file and add your database credentials:Once done, save the configuration file and now, you can try exporting your database without a hassle like this:Hope this trick helps you out!

1 minute read

If you're performing a mass database backup using mysqldump, you'll pretty much find it annoying to type in the password every single time.

To get rid of it, open /etc/mysql/my.cnf configuration file and add your database credentials:


[mysqldump]
user="your_username"
password="your_password"

Once done, save the my.cnf configuration file and now, you can try exporting your database without a hassle like this:


mysqldump -u your_username database_name > database.sql

Hope this trick helps you out!