Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

How to connect MySQL without using password

Answer:

1. Create a .my.cnf in your home folder

# vi ~/.my.cnf

2. Enter your MySQL login information and save the file.

[client]
user=john
password=john_password

3. Try typing mysql in shell and you should able to login automatically.

  1. Reset MySQL root password
  2. Can’t connect to local MySQL server through socket
  3. Connect MySQL server using C
  4. Create password file for basic Apache authentication
  5. How to create a new MySQL user?

Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>