HostOnNet Blog

Storing MySQL password in .my.cnf

Looking for Linux Server Admin or WordPress Expert? We can help.

Create ~/.my.cnf file

touch ~/.my.cnf
chmod 700 ~/.my.cnf

Edit file

vi ~/.my.cnf

Add following content

[client]
user = root
password = DBPASSWORD

[mysqladmin]
user = root
password = DBPASSWORD

[mysqldump]
user = root
password = DBPASSWORD

Now you will be able to login to server with out password.


Posted in MySQL

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.