$HOME/.my.cnf Put the following content in the .my.cnf file: [client] user = username passowrd = yourpassword Then, you can login like this: mysql