Skip to content

Setting password for mysql user in .my.cnf

Sometimes you want automated access for root on your MySQL database. One way of accomplishing that is by doing this:

cd /root
touch .my.cnf
chmod 640 .my.cnf

And put in it:

[client]
user=root
password=foobar

1 Comment ( Add comment / trackback )

  1. [...] Please set the password for MySQL in /root/.my.cnf for automated access. See this post fordetails. [...]

Post a comment

(required)
(required)

Your email is never published nor shared.

(optional)
Allowed HTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>