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.