Passwordless MySQL authentication with mysql_config_editor
What is mysql_config_editor
?
mysql_config_editor
is a MySQL tool can stores your authentication credentials in an obfuscated config file, allowing you to use MySQL client programs (e.g., mysqldump
) without having to provide credentials each time.
How to use it
Create a ~/.mylogin.cnf
file containing your database credentials by running the following:
Assuming the user root
and the host localhost
, we can run:
Enter password when prompted.
Client programs like mysql
and mysqldump
automatically check if a ~/.mylogin.cnf
exists. If you create one, you’ll be able to use these programs without needing to provide the username and password each time.
Passwordless authentication becomes very useful when automating MySQL-related tasks like database back ups .
Sources
Thanks for your comment . Once it's approved, it will appear here.
Leave a comment