Now that I have my plane tickets booked for the MySQL camp, I am very excited as I cannot wait to see my friends there. If you are planning to come, and your name isn't listed, please take a few moments to add it to the participants list.
Today, I was asked by a friend if there was a way to login to MySQL without having to specify password each time.
Sure, there is. If MySQL finds a .my.cnf file in your home directory it will read it and apply the configuration specified there. What that means is that if you place your user name and password in that file then you don't have to keep specifying the username and password.
For instance, you can put something like:
[mysql]
user=user
password=pass
[mysqladmin]
user=user
password=pass
This will save you having to type the boring username and password every time.
4 comments:
This is useful but this will compromise the database server's security.
But where can I find that .my.cnf file? is that file in the client or server side?
Is there any solution how to connect from Perl, Python, PHP etc. without password?
Thank you
Post a Comment