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!