Last Updated: February 25, 2016
·
356
· thomasgravina

MySQL on Debian - Avoid to type the password in command line.

Just create a file .my.cnf in your home directory:

[client]
user = <yourusername>
password = <yourpassword>

Then you should be able to run mysql without being asked for username and password.

Really helpful but not to use in a long term since the password is plain text in your home directory.