.my.cnf: MySQL User and Password

This is only for test environment and lazy people.

Every time we have to add MySQL username and password to log in. Using this way we can login without credentials.

MySQL Username and Password

After the below changes, you will be able to login without credentials. All the commands like mysql, mysqldump, mysqlcheck don’t need credentials.

ubuntu18:~# cat ~/.my.cnf
[client]
user=mysqlusername
password=mysqlpassword
root@ubuntu18:~#

Conclusion

This is just for ease.

Leave a Reply

Your email address will not be published. Required fields are marked *