Activities

April 2010
M T W T F S S
« Mar   May »
 1234
567891011
12131415161718
19202122232425
2627282930  

MySQL : Passwordless root login

How do I skip asking mysql root password every time I logged as  system “root” account ?

1. Create a “.my.cnf” in root user home directory.
2. add the following entry on it and save and quit.

[client]
user=”root”
pass=”HdfH8%KS9s”

3.  Change the file permission to 700.

[root@rc-040 ~vi ~/.my.cnf
<code>[root@rc-040 ~]# chmod 700 .my.cnf
[root@rc-040 ~]# ls -la  .my.cnf
-rwx------ 1 root root 37 Apr 11 22:20 .my.cnf

Same can be done for each users. But don’t forget to change the file permission.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>